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
- ActivatableAttribute(NTDDI_WIN8)
- ActivatableAttribute(Windows.Web.Syndication.ISyndicationItemFactory, NTDDI_WIN8)
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The SyndicationItem class has these types of members:
Constructors
The SyndicationItem class has these constructors.
| Constructor | Description |
|---|---|
| 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.
| Method | Description |
|---|---|
| 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.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the list of custom attributes of the element. | |
| Read-only | Gets the authors of an item. This property represents the collection of all the atom:author elements under atom:entry. | |
| Read/write | 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. | |
| Read-only | Gets a collection of categories of the feed. This property represents the collection of all the atom:category elements under atom:feed. | |
| Read/write | Gets or sets the Uniform Resource Identifier (URI) of the comments for the item. This property represents the /rss/channel/item/comments element. | |
| Read/write | Gets or sets the content of the item. | |
| Read-only | Gets a collection of the contributors of the feed. This property represents the collection of all the atom:contributor elements under atom:feed. | |
| Read-only | Gets the Uniform Resource Identifier (URI) of an editable media resource. | |
| Read-only | Gets the Uniform Resource Identifier (URI) of an editable resource. | |
| Read-only | Gets the list of child elements within the element. | |
| Read-only | Gets an ETag HTTP header. | |
| Read/write | Gets or sets the identifier for the syndication feed. | |
| Read-only | Gets the Uniform Resource Identifier (URI) of this item. AtomPubClient creates this property after new resource is created. | |
| Read/write | 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. | |
| Read/write | Gets or sets the most recent time the item was modified. This property represents the atom:updated element. | |
| Read-only | Gets the links contained in the item. | |
| Read/write | Gets or sets the local name of the element. | |
| Read/write | Gets or sets the namespace of the element. | |
| Read/write | Gets or sets the text content of the element. If the element contains only child elements, this property is NULL. | |
| Read/write | Gets or sets the date the item was published. | |
| Read/write | Gets or sets information about the rights of an item. This property represents the atom:rights element. | |
| Read/write | Gets or sets the source feed of the item. This property represents the atom:source element or the source element in RSS 2.0. | |
| Read/write | Gets or sets a summary of the item. | |
| Read/write | Gets 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.
| SyndicationItem | RSS Channel/Item | Atom entry | AtomPub |
|---|---|---|---|
| AttributeExtensions (foreign markup) | |||
| Authors | author | authors | |
| BaseUri | |||
| Categories | category | category | |
| CommentsUri | comments | ||
| Content | content | ||
| Contributors | contributor | ||
| EditMediaUri | link with rel="edit-media" | ||
| EditUri | link with rel="edit" | ||
| ElementExtensions (foreign markup) | |||
| Etag | ETag header after CreateResourceAsync | ||
| Id | guid | id | Location header after CreateResourceAsync |
| ItemUri | |||
| Language | xml:lang | xml:lang | |
| LastUpdatedTime | updated | ||
| Links | link/enclosure | link | |
| NodeName | |||
| NodeNamespace | |||
| NodeValue | |||
| PublishedDate | pubDate | published | |
| Rights | rights | ||
| Source | source | source | |
| Summary | description | summary | |
| Title | title | title |
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps, desktop apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps, desktop apps] |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012