SyndicationItem SyndicationItem SyndicationItem SyndicationItem Class

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.

Syntax

Declaration

public sealed class SyndicationItempublic sealed class SyndicationItemPublic NotInheritable Class SyndicationItem

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(Windows.Foundation.Uri,System.String,Windows.Web.Syndication.SyndicationItem)
Id guididLocation header after CreateResourceAsync(Windows.Foundation.Uri,System.String,Windows.Web.Syndication.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 summary

Creates a new SyndicationItem object.

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

Properties summary

Gets the list of custom attributes of the element.

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

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.

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

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

Gets or sets the content of the item.

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

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

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

Gets the list of child elements within the element.

Gets an ETag HTTP header.

Gets or sets the identifier for the syndication feed.

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

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.

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

Gets the links contained in the item.

Gets or sets the local name of the element.

Gets or sets the namespace of the element.

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

Gets or sets the date the item was published.

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

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

Gets or sets a summary of the item.

Gets or sets the title of the item.

Methods summary

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.

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

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

Constructors

  • SyndicationItem()
    SyndicationItem()
    SyndicationItem()
    SyndicationItem()

    Creates a new SyndicationItem object.

    public SyndicationItem()public SyndicationItem()Public Function SyndicationItem() As
  • SyndicationItem(System.String,Windows.Web.Syndication.SyndicationContent,Windows.Foundation.Uri)
    SyndicationItem(System.String,Windows.Web.Syndication.SyndicationContent,Windows.Foundation.Uri)
    SyndicationItem(System.String,Windows.Web.Syndication.SyndicationContent,Windows.Foundation.Uri)
    SyndicationItem(System.String,Windows.Web.Syndication.SyndicationContent,Windows.Foundation.Uri)

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

    public SyndicationItem(System.String title,Windows.Web.Syndication.SyndicationContent content,Windows.Foundation.Uri uri)public SyndicationItem(System.String title,Windows.Web.Syndication.SyndicationContent content,Windows.Foundation.Uri uri)Public Function SyndicationItem(title As System.String,content As Windows.Web.Syndication.SyndicationContent,uri As Windows.Foundation.Uri) As

    Parameters

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>

    Property Value

    • A list of attributes of the element.

  • 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>

    Property Value

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

  • 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 Uri

    Property Value

  • 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>

    Property Value

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

  • 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 Uri

    Property Value

  • 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 SyndicationContent

    Property Value

  • 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>

    Property Value

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

  • 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 Uri

    Property Value

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

    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 Uri

    Property Value

    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>

    Property Value

    • The list of child elements within the element.

    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 string

    Property Value

    • string
      string
      string
      string

      An Etag HTTP header.

    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 string

    Property Value

    • string
      string
      string
      string

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

  • 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 Uri

    Property Value

    • The Uniform Resource Identifier (URI) of the item.

  • 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 string

    Property Value

    • string
      string
      string
      string

      The xml:lang attribute on the element.

  • 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 DateTime LastUpdatedTime { get; set; }Public ReadWrite Property LastUpdatedTime As DateTime

    Property Value

  • 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 string

    Property Value

    • string
      string
      string
      string

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

  • 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 string

    Property Value

    • string
      string
      string
      string

      The namespace of the element.

  • 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 string

    Property Value

    • string
      string
      string
      string

      The text content of the element.

  • PublishedDate
    PublishedDate
    PublishedDate
    PublishedDate

    Gets or sets the date the item was published.

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

    Property Value

  • 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 ISyndicationText

    Property Value

  • 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 SyndicationFeed

    Property Value

  • 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 ISyndicationText

    Property Value

  • 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 ISyndicationText

    Property Value

Methods

  • GetXmlDocument(Windows.Web.Syndication.SyndicationFormat)
    GetXmlDocument(Windows.Web.Syndication.SyndicationFormat)
    GetXmlDocument(Windows.Web.Syndication.SyndicationFormat)
    GetXmlDocument(Windows.Web.Syndication.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(Windows.Web.Syndication.SyndicationFormat format)public XmlDocument GetXmlDocument(Windows.Web.Syndication.SyndicationFormat format)Public Function GetXmlDocument(format As Windows.Web.Syndication.SyndicationFormat) As XmlDocument

    Parameters

    Returns

  • Load(System.String)
    Load(System.String)
    Load(System.String)
    Load(System.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(System.String item)public void Load(System.String item)Public Function Load(item As System.String) As void

    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.

  • LoadFromXml(Windows.Data.Xml.Dom.XmlDocument)
    LoadFromXml(Windows.Data.Xml.Dom.XmlDocument)
    LoadFromXml(Windows.Data.Xml.Dom.XmlDocument)
    LoadFromXml(Windows.Data.Xml.Dom.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(Windows.Data.Xml.Dom.XmlDocument itemDocument)public void LoadFromXml(Windows.Data.Xml.Dom.XmlDocument itemDocument)Public Function LoadFromXml(itemDocument As Windows.Data.Xml.Dom.XmlDocument) As void

    Parameters

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Web.Syndication.dll