Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SyndicationItem class

Applies to Windows and Windows Phone

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


var syndicationItem = new Windows.Web.Syndication.SyndicationItem(string, syndicationContent, uri);
var syndicationItem = new Windows.Web.Syndication.SyndicationItem();

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

Members

The SyndicationItem class has these types of members:

Constructors

The SyndicationItem class has these constructors.

ConstructorDescription
SyndicationItem() Creates a new SyndicationItem object.
SyndicationItem(String, SyndicationContent, Uri) Creates a new SyndicationItem object with a title, content, and URI.

 

Methods

The SyndicationItem class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
GetXmlDocument 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 Initializes the object from the given feed string, which can be in either RSS 2.0 or Atom 1.0 format.
LoadFromXml Initializes the object from the given DOM object, which can contain XML content in either RSS 2.0 or Atom 1.0 format.

 

Properties

The SyndicationItem class has these properties.

PropertyAccess typeDescription

AttributeExtensions

Read-onlyGets the list of custom attributes of the element.

Authors

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

BaseUri

Read/writeGets 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

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

CommentsUri

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

Content

Read/writeGets or sets the content of the item.

Contributors

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

EditMediaUri

Read-onlyGets the Uniform Resource Identifier (URI) of an editable media resource.

EditUri

Read-onlyGets the Uniform Resource Identifier (URI) of an editable resource.

ElementExtensions

Read-onlyGets the list of child elements within the element.

ETag

Read-onlyGets an ETag HTTP header.

Id

Read/writeGets or sets the identifier for the syndication feed.

ItemUri

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

Language

Read/writeGets 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

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

Links

Read-onlyGets the links contained in the item.

NodeName

Read/writeGets or sets the local name of the element.

NodeNamespace

Read/writeGets or sets the namespace of the element.

NodeValue

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

PublishedDate

Read/writeGets or sets the date the item was published.

Rights

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

Source

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

Summary

Read/writeGets or sets a summary of the item.

Title

Read/writeGets or sets the title of the item.

 

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;
}

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/Item Atom entry 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
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

 

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.Syndication
Windows::Web::Syndication [C++]

Metadata

Windows.winmd

See also

Quickstart: Accessing a web feed
Syndication sample
AtomPub sample

 

 

Show:
© 2014 Microsoft. All rights reserved.