SyndicationItem 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 SyndicationItem : ISyndicationItem, ISyndicationNode
struct winrt::Windows::Web::Syndication::SyndicationItem : ISyndicationItem, ISyndicationNode
public sealed class SyndicationItem : ISyndicationItem, ISyndicationNode
Public NotInheritable Class SyndicationItem Implements ISyndicationItem, ISyndicationNode
var syndicationItem = new 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 entryAtomPub
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
Id guididLocation header after CreateResourceAsync
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() SyndicationItem()

Creates a new SyndicationItem object.

SyndicationItem(String, SyndicationContent, Uri) 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.

Properties

AttributeExtensions AttributeExtensions AttributeExtensions AttributeExtensions AttributeExtensions

Gets the list of custom attributes of the element.

Authors Authors Authors Authors Authors

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

BaseUri 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.

Categories 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.

CommentsUri 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.

Content Content Content Content Content

Gets or sets the content of the item.

Contributors 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.

EditMediaUri EditMediaUri EditMediaUri EditMediaUri EditMediaUri

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

EditUri EditUri EditUri EditUri EditUri

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

ElementExtensions ElementExtensions ElementExtensions ElementExtensions ElementExtensions

Gets the list of child elements within the element.

ETag ETag ETag ETag ETag

Gets an ETag HTTP header.

Id Id Id Id Id

Gets or sets the identifier for the syndication feed.

ItemUri ItemUri ItemUri ItemUri ItemUri

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

Language 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.

LastUpdatedTime LastUpdatedTime LastUpdatedTime LastUpdatedTime LastUpdatedTime

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

Links Links Links Links Links

Gets the links contained in the item.

NodeName NodeName NodeName NodeName NodeName

Gets or sets the local name of the element.

NodeNamespace NodeNamespace NodeNamespace NodeNamespace NodeNamespace

Gets or sets the namespace of the element.

NodeValue NodeValue NodeValue NodeValue NodeValue

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

PublishedDate PublishedDate PublishedDate PublishedDate PublishedDate

Gets or sets the date the item was published.

Rights Rights Rights Rights Rights

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

Source 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.

Summary Summary Summary Summary Summary

Gets or sets a summary of the item.

Title Title Title Title Title

Gets or sets the title of the item.

Methods

GetXmlDocument(SyndicationFormat) 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.

Load(String) 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.

LoadFromXml(XmlDocument) 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.

See Also