RSS <channel>
Element
The <channel>
element in RSS describes the RSS feed.
RSS <channel>
Element
Consider the following RSS document:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>tutorialpro.org Homepage</title>
<link>http://www.tutorialpro.org</link>
<description>Free Programming Tutorials</description>
<item>
<title>RSS Tutorial</title>
<link>http://www.tutorialpro.org/rss</link>
<description>tutorialpro.org Rss Tutorial</description>
</item>
</channel>
</rss>
As mentioned earlier, the <channel>
element describes the RSS feed and has three required child elements:
<title>
- Defines the title of the channel. (e.g., tutorialpro.org Homepage)<link>
- Defines the hyperlink to the channel. (e.g., http://www.tutorialpro.org)<description>
- Describes the channel. (e.g., Free Programming Tutorials)
The <channel>
usually contains one or more <item>
elements. Each <item>
element defines an article or "story" in the RSS feed.
Additionally, there are several optional child elements of <channel>
. We will cover the most important ones later.
<category>
Element
The <category>
child element specifies the category for the feed.
The <category>
child element allows RSS aggregators to group websites based on categories.
The category for the above RSS document might be:
<category>Web Development</category>
<copyright>
Element
The <copyright>
child element informs about the copyright information.
The copyright for the above RSS document might be:
<copyright>2006 Refsnes Data as. All rights reserved.</copyright>
<image>
Element
The <image>
child element displays an image when the aggregator presents a feed.
The <image>
has three required child elements:
<url>
- Defines the URL of the image<title>
- Defines the text to display if the image cannot be shown<link>
- Defines the hyperlink to the website providing the channel
The image for the above RSS document might be:
<image>
<url>http://www.tutorialpro.org/images/logo.png</url>
<title>tutorialpro.org</title>
<link>http://www.tutorialpro.org</link>
</image>
<language>
Element
The <language>
child element specifies the language used to write the document.
The <language>
element allows RSS aggregators to group websites based on language.
The language for the above RSS document might be:
<language>zh-cn</language>
RSS <channel>
Reference Manual
Element | Description |
---|---|
<category> | Optional. Defines one or more categories for the feed. |
<cloud> | Optional. Registers a process to receive immediate notifications of feed updates. |
<copyright> | Optional. Informs about copyright information. |
<description> | Required. Describes the channel. |
<docs> | Optional. Specifies the URL to the documentation of the RSS file format. |
<generator> | Optional. Specifies the program used to generate the feed. |
<image> | Optional. Displays an image when the aggregator presents a feed. |
<language> | Optional. Specifies the language used to write the feed. |
<lastBuildDate> | Optional. Defines the last modification date of the feed content. |
<link> | Required. Defines the hyperlink to the channel. |
<managingEditor> | Optional. Defines the email address of the feed content editor. |
<pubDate> | Optional. Defines the last publication date of the feed content. |
<rating> | Optional. The PICS rating of the feed. |
<skipDays> | Optional. Specifies the days to ignore feed updates. |
<skipHours> | Optional. Specifies the hours to ignore feed updates. |
<textInput> | Optional. Specifies the text input field to be displayed with the feed. |
<title> | Required. Defines the title of the channel. |
<ttl> | Optional. Specifies the number of minutes the feed can be cached before refreshing from the source. |
<webMaster> | Optional. Defines the email address of the webmaster for the feed. |