This topic has not yet been rated - Rate this topic

SyndicationFeed Class

Represents a top-level feed object, <feed> in Atom 1.0 and <rss> in RSS 2.0.

System.Object
  System.ServiceModel.Syndication.SyndicationFeed

Namespace:  System.ServiceModel.Syndication
Assembly:  System.ServiceModel.Syndication (in System.ServiceModel.Syndication.dll)
public class SyndicationFeed

The SyndicationFeed type exposes the following members.

  Name Description
Public method SyndicationFeed() Initializes a new instance of the SyndicationFeed class.
Public method SyndicationFeed(IEnumerable<SyndicationItem>) Initializes a new instance of the SyndicationFeed class with the specified collection of SyndicationItem objects.
Protected method SyndicationFeed(SyndicationFeed, Boolean) Creates a new instance of the SyndicationFeed class with the specified feed.
Public method SyndicationFeed(String, String, Uri) Initializes a new instance of the SyndicationFeed class with the specified title, description, and Uniform Resource Identifier (URI).
Public method SyndicationFeed(String, String, Uri, IEnumerable<SyndicationItem>) Initializes a new instance of the SyndicationFeed class with the specified title, description, URI, and collection of SyndicationItem objects.
Public method SyndicationFeed(String, String, Uri, String, DateTimeOffset) Creates a new instance of the SyndicationFeed class.
Public method SyndicationFeed(String, String, Uri, String, DateTimeOffset, IEnumerable<SyndicationItem>) Creates a new instance of the SyndicationFeed class.
Top
  Name Description
Public property AttributeExtensions Gets a collection of attribute extensions.
Public property Authors Gets a collection of authors of the feed.
Public property BaseUri Gets or sets the base URI for the SyndicationFeed instance.
Public property Categories Gets a collection of categories for the feed.
Public property Contributors Gets a collection of the contributors to the feed.
Public property Copyright Gets or sets copyright information for the feed.
Public property Description Gets or sets a description of the feed.
Public property ElementExtensions Gets the element extensions for the feed.
Public property Generator Gets or sets the generator of the feed.
Public property Id Gets or sets the ID of the feed.
Public property ImageUrl Gets or sets the image URL for the feed.
Public property Items Gets a collection of the feed items contained in the feed.
Public property Language Gets or sets the language of the feed.
Public property LastUpdatedTime Gets or sets the time the feed was last updated.
Public property Links Gets the links associated with the feed.
Public property Title Gets or sets the title of the feed.
Top
  Name Description
Public method Clone Creates a copy of the SyndicationFeed instance.
Protected method CreateCategory Creates a new SyndicationCategory instance.
Protected method CreateItem Creates a new SyndicationItem instance.
Protected method CreateLink Creates a new SyndicationLink instance.
Protected method CreatePerson Creates a new SyndicationPerson instance.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public method GetAtom10Formatter Gets an Atom10FeedFormatter instance.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetRss20Formatter() Gets an Rss20FeedFormatter instance.
Public method GetRss20Formatter(Boolean) Gets a new Rss20FeedFormatter instance.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Static member Load(XmlReader) Loads a syndication feed from the specified XML reader.
Public method Static member Load<TSyndicationFeed>(XmlReader) Loads a SyndicationFeed-derived instance from the specified XmlReader.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SaveAsAtom10 Write the syndication feed to the specified XmlWriter in Atom 1.0 format.
Public method SaveAsRss20 Write the syndication feed to the specified XmlWriter in RSS 2.0 format.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Protected method TryParseAttribute Attempts to parse an attribute extension.
Protected method TryParseElement Attempts to parse an element extension.
Protected method WriteAttributeExtensions Writes the attribute extensions to the specified XmlWriter using the specified syndication version.
Protected method WriteElementExtensions Writes the element extensions to the specified XmlWriter using the specified syndication version.
Top

When serialized to Atom 1.0, a SyndicationFeed instance is written to a <feed> element. The following table shows how each property defined in the SyndicationFeed class is serialized to Atom 1.0.

SyndicationFeed property

Serialized form

AttributeExtensions

An attribute in the <feed> element for each attribute in the collection.

Authors

An <author> element for each SyndicationPerson in the collection.

Categories

A <category> element for each SyndicationCategory in the collection.

Contributors

A <contributor> element for each SyndicationPerson in the collection.

Copyright

A <rights> element.

Description

A <subtitle> element.

ElementExtensions

Each element in the collection is written within the <feed> element.

Generator

A <generator> element.

Id

An <id>element.

ImageUri

A <logo> element.

Items

An <entry> element for each SyndicationItem in the collection.

Language

Not serialized.

LastUpdatedTime

An <updated> element.

Links

A <link> element for each SyndicationLink in the collection.

Title

A <title> element.

When serialized to RSS 2.0, a SyndicationFeed instance is written to an <rss> element. The following table shows how each property defined in the SyndicationFeed class is serialized to RSS 2.0.

SyndicationFeed property

Serialized form

AttributeExtensions

An attribute in the <channel> element for each attribute in the collection.

Authors

A <managingEditor> element if only one SyndicationPerson is in the collection; otherwise, an <a10:author> element for each SyndicationPerson in the collection.

Categories

A <category> element for each SyndicationCategory in the collection.

Contributors

An <a10:contributor> element for each SyndicationPerson in the collection.

Copyright

A <copyright> element.

Description

A <description> element.

ElementExtensions

Each element in the collection is written within the <channel> element.

Generator

A <generator> element.

Id

An <a10:id> element.

ImageUri

An <image> element.

Items

An <item> element for each SyndicationItem in the collection.

Language

A <language> element.

LastUpdatedTime

A <lastBuildDate> element.

Links

An <a10:link> element for each SyndicationLink in the collection.

Title

A <title> element.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Think twice
It's great to have this functionality, but my experience with it has been poor.  If I'm using this class, I'm just trying to read a syndication feed.  But this class is very brittle, and throws exceptions for any improper XML formatting or schema deviation.  Which is certainly correct, but it is not at all useful because it prevents me from reader the great number of out-of-spec RSS and Atom feeds out there.  Like me, when you run into this you'll ask around online and find out that most people either end up subclassing XmlTextReader or just using XDocument to parse the XML instead.  So spare yourself the frustration, and skip this well-intentioned but ultimately useless library.
Solved the problem with the SyndicationFeed
The solution I found out through another demo is to go in the "normal" project (w/o the .Web extension) onto the "References" folder in the MVS2010 (alias "Verweise" in the German version), click there the right mouse button and select "Add references..." ("Verweis hinzufügen..."). The list is populated also with elements having the version 2.0.5.0. There, the System.ServiceModel.Syndication exists! And there is no error message concerning the SyndicationFeed anymore!
How I could solve the problem with missing SyndicationFeed
The solution I found out through another demo is to go in the "normal" project (i.e. w/o the ".Web" extension, like "TwitterSearchProject") onto the "References" folder in the MVS2010 (alias "Verweise" in the German version), click there the right mouse button and select "Add references..." ("Verweis hinzufügen..."). The list is populated also with elements having the version 2.0.5.0. There, the System.ServiceModel.Syndication exists! And there is no error message concerning the SyndicationFeed anymore!
Don't panic!
In 4.0 of the framework the Syndication classes have moved assemblies, as of 4.0 of the framework they are now in the System.ServiceModel (not in System.ServiceModel.Web).
You must add a reference to the SL 3.0 DLL
The class is missing form SL 4.0 so you must add a reference to the 3.0 DLL located at "<rootDrive>;\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.ServiceModel.Syndication.dll"
System.ServiceModel.Syndication doesn't exist in version 4!
This info is wrong. There is no such thing as System.ServiceModel.Syndication, and I can't find any class called SyndicationFeedanywhere else.

See http://forums.silverlight.net/forums/t/145082.aspx for a kludge to work around this bug.

Microsoft, fix your code!