SyndicationItem SyndicationItem SyndicationItem SyndicationItem Class

Definition

Represents an item in the feed. This class encapsulates information in the /rss/channel/item element in RSS 2.0 or the atom:entry element in Atom 1.0.

public sealed class SyndicationItempublic sealed class SyndicationItemPublic NotInheritable Class SyndicationItempublic sealed class SyndicationItem
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The following code demonstrates how to access the property values of a SyndicationItem object.


function displayCurrentItem() {
    var item = currentFeed.items[currentItemIndex];

    // Title.
    var title = item.title || "(no title)";
    document.getElementById("feedItemTitle").innerText = title;

    // Display the main link.
    var link = "";
    if (item.links.size > 0) {
        link = item.links[0].uri.absoluteUri;
    }

    var feedLink = document.getElementById("feedLink");
    feedLink.innerText = link;
    feedLink.href = link;

    // Display the body as HTML.
    var content = item.content || item.summary || "(no content)";
    document.getElementById("feedWebView").innerHTML = content;
}

using Windows.Foundation;
using Windows.Web.Syndication;

private void DisplayCurrentItem()
{
    SyndicationItem item = currentFeed.Items[currentItemIndex];

    // Title
    FeedItemTitle.Text = item.Title != null ? item.Title.Text : "(no title)";

    // Display the main link
    string link = string.Empty;
    if (item.Links.Count > 0)
    {
    link = item.Links[0].Uri.AbsoluteUri;
    }
    FeedLink.Content = link;

    // Display the body as HTML
    string content = "(no content)";
    if (item.Content != null)
    {
        content = item.Content.Text;
    }
    else if (item.Summary != null)
    {
        content = item.Summary.Text;
    }
    FeedWebView.NavigateToString(content);
}

For additional examples that demonstrate how this class is used to represent feed content, see Quickstart: Accessing a web feed.

The following table maps SyndicationItem properties to RSS and Atom feed elements.

SyndicationItemRSS Channel/ItemAtom entryWindows.Web.AtomPub
AttributeExtensions (foreign markup)
Authors authorauthors
BaseUri
Categories categorycategory
CommentsUri comments
Content content
Contributors contributor
EditMediaUri link with rel="edit-media"
EditUri link with rel="edit"
ElementExtensions (foreign markup)
EtagETag header after CreateResourceAsync(Uri, String, SyndicationItem)
Id guididLocation header after CreateResourceAsync(Uri, String, SyndicationItem)
ItemUri
Language xml:langxml:lang
LastUpdatedTime updated
Links link/enclosurelink
NodeName
NodeNamespace
NodeValue
PublishedDate pubDatepublished
Rights rights
Source sourcesource
Summary descriptionsummary
Title titletitle

Constructors

SyndicationItem() SyndicationItem() SyndicationItem() SyndicationItem()

Creates a new SyndicationItem object.

public SyndicationItem()public New()Public Sub New()public SyndicationItem()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

SyndicationItem(String, SyndicationContent, Uri) SyndicationItem(String, SyndicationContent, Uri) SyndicationItem(String, SyndicationContent, Uri) SyndicationItem(String, SyndicationContent, Uri)

Creates a new SyndicationItem object with a title, content, and URI.

public SyndicationItem(String title, SyndicationContent content, Uri uri)public New(String title, SyndicationContent content, Uri uri)Public Sub New(title As String, content As SyndicationContent, uri As Uri)public SyndicationItem(String title, SyndicationContent content, Uri uri)
Parameters
title
System.String System.String System.String System.String

Title of the new item.

uri
Uri Uri Uri Uri

The URI associated with this item.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

AttributeExtensions AttributeExtensions AttributeExtensions AttributeExtensions

Gets the list of custom attributes of the element.

public IVector<SyndicationAttribute> AttributeExtensions { get; }public IVector<SyndicationAttribute> AttributeExtensions { get; }Public ReadOnly Property AttributeExtensions As IVector<SyndicationAttribute>public IVector<SyndicationAttribute> AttributeExtensions { get; }
Value

A list of attributes of the element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Authors Authors Authors Authors

Gets the authors of an item. This property represents the collection of all the atom:author elements under atom:entry.

public IVector<SyndicationPerson> Authors { get; }public IVector<SyndicationPerson> Authors { get; }Public ReadOnly Property Authors As IVector<SyndicationPerson>public IVector<SyndicationPerson> Authors { get; }
Value

The collection of all the atom:author elements under atom:entry.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

BaseUri BaseUri BaseUri BaseUri

Gets or sets the base URI for the element. This property represents the xml:base attribute on the element. It may be inherited from an ancestor element.

public Uri BaseUri { get; set; }public Uri BaseUri { get; set; }Public ReadWrite Property BaseUri As Uripublic Uri BaseUri { get; set; }
Value
Uri Uri Uri Uri

The xml:base attribute on the element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Categories Categories Categories Categories

Gets a collection of categories of the feed. This property represents the collection of all the atom:category elements under atom:feed.

public IVector<SyndicationCategory> Categories { get; }public IVector<SyndicationCategory> Categories { get; }Public ReadOnly Property Categories As IVector<SyndicationCategory>public IVector<SyndicationCategory> Categories { get; }
Value

The collection of all atom:category elements under atom:feed.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

CommentsUri CommentsUri CommentsUri CommentsUri

Gets or sets the Uniform Resource Identifier (URI) of the comments for the item. This property represents the /rss/channel/item/comments element.

public Uri CommentsUri { get; set; }public Uri CommentsUri { get; set; }Public ReadWrite Property CommentsUri As Uripublic Uri CommentsUri { get; set; }
Value
Uri Uri Uri Uri

The /rss/channel/item/comments element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Content Content Content Content

Gets or sets the content of the item.

public SyndicationContent Content { get; set; }public SyndicationContent Content { get; set; }Public ReadWrite Property Content As SyndicationContentpublic SyndicationContent Content { get; set; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Contributors Contributors Contributors Contributors

Gets a collection of the contributors of the feed. This property represents the collection of all the atom:contributor elements under atom:feed.

public IVector<SyndicationPerson> Contributors { get; }public IVector<SyndicationPerson> Contributors { get; }Public ReadOnly Property Contributors As IVector<SyndicationPerson>public IVector<SyndicationPerson> Contributors { get; }
Value

The collection of all atom:contributor elements under atom:feed.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

EditMediaUri EditMediaUri EditMediaUri EditMediaUri

Gets the Uniform Resource Identifier (URI) of an editable media resource.

public Uri EditMediaUri { get; }public Uri EditMediaUri { get; }Public ReadOnly Property EditMediaUri As Uripublic Uri EditMediaUri { get; }
Value
Uri Uri Uri Uri

The atom:link element with the attribute rel=”edit-media”.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This property represents the atom:link element with the attribute rel=”edit-media”. It is the absolute Uniform Resource Identifier (URI) resolved against the xml:base attribute, if it is present. If the href attribute is a relative Uniform Resource Identifier (URI) string and there is no xml:base attribute, this property will be null since the relative Uniform Resource Identifier (URI) is not supported by the runtime Uniform Resource Identifier (URI) class.

EditUri EditUri EditUri EditUri

Gets the Uniform Resource Identifier (URI) of an editable resource.

public Uri EditUri { get; }public Uri EditUri { get; }Public ReadOnly Property EditUri As Uripublic Uri EditUri { get; }
Value
Uri Uri Uri Uri

The atom:link element with rel="edit".

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This property represents the atom:link element with the attribute rel=”edit”. It is the absolute Uniform Resource Identifier (URI) resolved against the xml:base attribute, if it is present. If the href attribute is a relative Uniform Resource Identifier (URI) string and there is no xml:base attribute, this property will be null since the relative Uniform Resource Identifier (URI) is not supported by the runtime Uniform Resource Identifier (URI) class.

ElementExtensions ElementExtensions ElementExtensions ElementExtensions

Gets the list of child elements within the element.

public IVector<ISyndicationNode> ElementExtensions { get; }public IVector<ISyndicationNode> ElementExtensions { get; }Public ReadOnly Property ElementExtensions As IVector<ISyndicationNode>public IVector<ISyndicationNode> ElementExtensions { get; }
Value

The list of child elements within the element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The following elements in the RSS 2.0 documents do not have public accessors;they can be accessed by searching the ElementExtensions collection on the SyndicationFeed object:

  • /rss/channel/docs
  • /rss/channel/cloud
  • /rss/channel/pubDate
  • /rss/channel/webmaster
  • /rss/channel/ttl
  • /rss/channel/rating
  • /rss/channel/textInput
  • /rss/channel/skipDays
  • /rss/channel/skipHours

ETag ETag ETag ETag

Gets an ETag HTTP header.

public string ETag { get; }public string ETag { get; }Public ReadOnly Property ETag As stringpublic string ETag { get; }
Value
string string string string

An Etag HTTP header.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

When an AtomPub endpoint returns a syndication entry, it may include an ETag HTTP header, which will be tied to the SyndicationItem object and show up in this property. AtomPubClient will also use ETag when updating or deleting a resource for synchronization control.

Id Id Id Id

Gets or sets the identifier for the syndication feed.

public string Id { get; set; }public string Id { get; set; }Public ReadWrite Property Id As stringpublic string Id { get; set; }
Value
string string string string

The atom:Id element or the guid element in RSS 2.0.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

ItemUri ItemUri ItemUri ItemUri

Gets the Uniform Resource Identifier (URI) of this item. AtomPubClient creates this property after new resource is created.

public Uri ItemUri { get; }public Uri ItemUri { get; }Public ReadOnly Property ItemUri As Uripublic Uri ItemUri { get; }
Value
Uri Uri Uri Uri

The Uniform Resource Identifier (URI) of the item.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Language Language Language Language

Gets or sets the language of the element. This property represents the xml:lang attribute on the element. It may be inherited from an ancestor element. It must be valid according to XML 1.0.

public string Language { get; set; }public string Language { get; set; }Public ReadWrite Property Language As stringpublic string Language { get; set; }
Value
string string string string

The xml:lang attribute on the element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

LastUpdatedTime LastUpdatedTime LastUpdatedTime LastUpdatedTime

Gets or sets the most recent time the item was modified. This property represents the atom:updated element.

public DateTime LastUpdatedTime { get; set; }public DateTimeOffset LastUpdatedTime { get; set; }Public ReadWrite Property LastUpdatedTime As DateTimeOffsetpublic DateTime LastUpdatedTime { get; set; }
Value
DateTime DateTime DateTime DateTime

The atom:updated element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Gets the links contained in the item.

public IVector<SyndicationLink> Links { get; }public IVector<SyndicationLink> Links { get; }Public ReadOnly Property Links As IVector<SyndicationLink>public IVector<SyndicationLink> Links { get; }
Value

The collection of all the atom:link elements under atom:entry.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This property represents the collection of all the atom:link elements under atom:entry. For RSS 2.0, this collection includes link, enclosure, and comments elements.

NodeName NodeName NodeName NodeName

Gets or sets the local name of the element.

public string NodeName { get; set; }public string NodeName { get; set; }Public ReadWrite Property NodeName As stringpublic string NodeName { get; set; }
Value
string string string string

The local name of the element. Must be valid according to XML 1.0.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

NodeNamespace NodeNamespace NodeNamespace NodeNamespace

Gets or sets the namespace of the element.

public string NodeNamespace { get; set; }public string NodeNamespace { get; set; }Public ReadWrite Property NodeNamespace As stringpublic string NodeNamespace { get; set; }
Value
string string string string

The namespace of the element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

NodeValue NodeValue NodeValue NodeValue

Gets or sets the text content of the element. If the element contains only child elements, this property is NULL.

public string NodeValue { get; set; }public string NodeValue { get; set; }Public ReadWrite Property NodeValue As stringpublic string NodeValue { get; set; }
Value
string string string string

The text content of the element.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

PublishedDate PublishedDate PublishedDate PublishedDate

Gets or sets the date the item was published.

public DateTime PublishedDate { get; set; }public DateTimeOffset PublishedDate { get; set; }Public ReadWrite Property PublishedDate As DateTimeOffsetpublic DateTime PublishedDate { get; set; }
Value
DateTime DateTime DateTime DateTime

The atom:published element under atom:entry or the pubDate element under item element in RSS 2.0.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Rights Rights Rights Rights

Gets or sets information about the rights of an item. This property represents the atom:rights element.

public ISyndicationText Rights { get; set; }public ISyndicationText Rights { get; set; }Public ReadWrite Property Rights As ISyndicationTextpublic ISyndicationText Rights { get; set; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Source Source Source Source

Gets or sets the source feed of the item. This property represents the atom:source element or the source element in RSS 2.0.

public SyndicationFeed Source { get; set; }public SyndicationFeed Source { get; set; }Public ReadWrite Property Source As SyndicationFeedpublic SyndicationFeed Source { get; set; }
Value
SyndicationFeed SyndicationFeed SyndicationFeed SyndicationFeed

The atom:source element or the source element in RSS 2.0.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Summary Summary Summary Summary

Gets or sets a summary of the item.

public ISyndicationText Summary { get; set; }public ISyndicationText Summary { get; set; }Public ReadWrite Property Summary As ISyndicationTextpublic ISyndicationText Summary { get; set; }
Value
ISyndicationText ISyndicationText ISyndicationText ISyndicationText

The atom:summary element or the description element in RSS 2.0.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Title Title Title Title

Gets or sets the title of the item.

public ISyndicationText Title { get; set; }public ISyndicationText Title { get; set; }Public ReadWrite Property Title As ISyndicationTextpublic ISyndicationText Title { get; set; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

GetXmlDocument(SyndicationFormat) GetXmlDocument(SyndicationFormat) GetXmlDocument(SyndicationFormat) GetXmlDocument(SyndicationFormat)

Generates the DOM object that represents this element, all the attributes and child elements including foreign markups. The only formats accepted by this method are Atom 1.0 and RSS 2.0.

public XmlDocument GetXmlDocument(SyndicationFormat format)public XmlDocument GetXmlDocument(SyndicationFormat format)Public Function GetXmlDocument(format As SyndicationFormat) As XmlDocumentpublic XmlDocument GetXmlDocument(SyndicationFormat format)
Parameters
Returns

The DOM object that represents this element, and all the attributes and child elements, including foreign markups.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Load(String) Load(String) Load(String) Load(String)

Initializes the object from the given feed string, which can be in either RSS 2.0 or Atom 1.0 format.

public void Load(String item)public void Load(String item)Public Function Load(item As String) As voidpublic void Load(String item)
Parameters
item
System.String System.String System.String System.String

The feed string, which can be in either RSS 2.0 or Atom 1.0 format.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

LoadFromXml(XmlDocument) LoadFromXml(XmlDocument) LoadFromXml(XmlDocument) LoadFromXml(XmlDocument)

Initializes the object from the given DOM object, which can contain XML content in either RSS 2.0 or Atom 1.0 format.

public void LoadFromXml(XmlDocument itemDocument)public void LoadFromXml(XmlDocument itemDocument)Public Function LoadFromXml(itemDocument As XmlDocument) As voidpublic void LoadFromXml(XmlDocument itemDocument)
Parameters
itemDocument
XmlDocument XmlDocument XmlDocument XmlDocument

The DOM object, which can contain XML content in either RSS 2.0 or Atom 1.0 format.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)