Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

AtomFeed

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atomfeed - npm Package Compare versions

Comparing version
1.0.0
to
1.1.0
services/metadata/...44a6547c4f7d44549efe924ecb7f942c.psmdcp

Sorry, the diff of this file is not supported yet

+2
-2

@@ -5,3 +5,3 @@ <?xml version="1.0" encoding="utf-8"?>

<id>AtomFeed</id>
<version>1.0.0</version>
<version>1.1.0</version>
<authors>chrishyze</authors>

@@ -14,3 +14,3 @@ <license type="expression">MIT</license>

<tags>Atom Feed RSS</tags>
<repository type="git" url="https://github.com/chrishyze/AtomFeed" commit="84e74a1519877030f7040304f866f1870f7cf20e" />
<repository type="git" url="https://github.com/chrishyze/AtomFeed" commit="48d36ab9001cdcbbcd1e45ae4d94be985aad88f2" />
<dependencies>

@@ -17,0 +17,0 @@ <group targetFramework="net8.0" />

# AtomFeed
[![](https://img.shields.io/nuget/v/AtomFeed.svg)](https://www.nuget.org/packages/AtomFeed)
[![](https://github.com/chrishyze/AtomFeed/workflows/Tests/badge.svg?branch=main)](https://github.com/chrishyze/AtomFeed/workflows/Tests)
[![](https://github.com/chrishyze/AtomFeed/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/chrishyze/AtomFeed/workflows/Tests)
[![](https://img.shields.io/badge/license-MIT-informational)](https://www.nuget.org/packages/AtomFeed)

@@ -9,5 +9,21 @@

This project is a .NET implement of [The Atom Syndication Format (RFC 4287)](https://datatracker.ietf.org/doc/html/rfc4287).
Follows and conforms to [W3C Atom feed validation](https://validator.w3.org/feed/docs/atom.html).
This project is a .NET implement of Atom 1.0.
## Features
- Serialize atom feed into XML document
- Deserialize atom feed from XML
- Follows and conforms to [W3C Atom feed validation](https://validator.w3.org/feed/docs/atom.html).
## Get Started
You may want to learn about the Atom from the links below:
- [Atom (web standard) - Wikipedia](https://en.wikipedia.org/wiki/Atom_(web_standard)) (Include a comparison to the RSS 2.0)
- [The Atom Syndication Format (RFC 4287) - IETF](https://datatracker.ietf.org/doc/html/rfc4287)
Most of the modern feed readers support Atom.
You can use this library to build a feed server, or build an app to handle Atom feeds.
## Installation

@@ -21,2 +37,4 @@

### Basic usage
Serialize:

@@ -44,3 +62,3 @@

var xmlDocument = AtomFeed.Serialize(feed);
var xmlDocument = Atom.Serialize(feed);
```

@@ -53,7 +71,48 @@

var feed = AtomFeed.Deserialize(xml);
const string xml =
"""
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>urn:uuid:01931011-954d-71ee-ade5-0146811ae69f</id>
<title>Sample Feed</title>
<updated>2024-11-09T08:36:48Z</updated>
</feed>
""";
var feed = Atom.Deserialize(xml);
```
### Strict mode in deserialization
Normally, the strict mode is disabled, when the giving feed is invalid, the parser will return `null`.
If the strict mode is enabled, the parser will throw an exception.
The strict mode can be used to validate the feed, it follows the [W3C Atom feed validation](https://validator.w3.org/feed/docs/atom.html).
```csharp
var xml = string.Empty;
// An System.Data.ArgumentException will be thrown,
// because the feed is empty.
var feed = Atom.Deserialize(xml, true);
```
```csharp
const string xml =
"""
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
</feed>
""";
// An System.Data.ConstraintException will be thrown,
// because the feed <id> tag is missing.
var feed = Atom.Deserialize(xml, true);
```
See more in the [DeserializeStrictModeTests.cs](https://github.com/chrishyze/AtomFeed/blob/main/tests/AtomFeed.Tests/DeserializeStrictModeTests.cs)
## License
The MIT License

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet