RSS <channel> Element
- Previous Page RSS Syntax
- Next Page RSS <item>
The <channel> element of RSS can describe the RSS feed.
RSS <channel> Element
Please see the following RSS document:
<?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"> <channel> <title>CodeW3C.com Home Page</title> <link>http://www.codew3c.com</link> <description>Free web building tutorials</description> <item> <title>RSS Tutorial</title> <link>http://www.codew3c.com/rss</link> <description>New RSS tutorial on CodeW3C.com</description> </item> </channel> </rss>
As mentioned earlier, the <channel> element can describe the RSS feed and has three mandatory sub-elements:
- <title> - Defines the title of the channel. (e.g., CodeW3C Home Page)
- <link> - Defines the hyperlink to reach the channel. (e.g., www.codew3c.com)
- <description> - Describes this channel (e.g., free website construction tutorials)
<channel> usually contains one or more <item> elements. Each <item> element can define an article or "story" in the RSS feed.
In addition, there are several optional sub-elements of <channel>. We will explain the most important ones later.
<category> element
<category> sub-element is used to specify the type of feed.
<category> sub-element makes it possible for RSS aggregators to group websites based on categories.
The categories of the above RSS document may be:
<category>Web development</category>
<copyright> Element
The <copyright> sub-element will inform about the version information.
The version of the above RSS document may be
<copyright>2006 codew3c.com. All rights reserved.</copyright>
<image> Element
The <image> sub-element can display an image when an aggregator provides a feed.
The <image> element has three required sub-elements:
- <url> - Defines the URL that refers to the image
- <title> - Defines the text displayed when the image cannot be displayed
- <link> - Defines the hyperlink to the website providing this channel
The image of the above RSS document may be like this:
<image> <url>http://www.codew3c.com/images/logo.gif</url> <title>codew3c.com</title> <link>http://www.codew3c.com</link> </image>
<language> Element
The <language> sub-element is used to specify the language used to write the document.
<language> Elements make it possible for RSS aggregators to group websites based on language.
The language of the above RSS document may be:
<language>en-us</language>
RSS <channel> Reference Manual
Element | Description |
---|---|
<category> | Optional. Defines one or more categories to which the feed belongs. |
<cloud> | Optional. Registers a process to receive immediate notifications for feed updates. |
<copyright> | Optional. Informs about the copyright information. |
<description> | Required. Describes the channel. |
<docs> | Optional. Specifies the URL that points to the documentation of the format used for the current RSS file. |
<generator> | Optional. Specifies the program used to generate the feed. |
<image> | Optional. Displays an image when an aggregator presents a feed. |
<language> | Optional. Specifies the language used to write the feed. |
<lastBuildDate> | Optional. Defines the last modified date of the feed content. |
<link> | Required. Defines the hyperlink pointing to the channel. |
<managingEditor> | Optional. Defines the email address for editing the feed content. |
<pubDate> | Optional. Defines the last published date of the feed's content. |
<rating> | Optional. The PICS rating of the feed. |
<skipDays> | Optional. Specifies the days to ignore when updating the feed. |
<skipHours> | Optional. Specifies the hours to ignore when updating the feed. |
<textInput> | Optional. Specifies the text input field that should be displayed along with the feed. |
<title> | Required. Defines the title of the channel. |
<ttl> | Optional. Specifies the number of minutes a feed can be cached before it is updated from the feed source. |
<webMaster> | Optional. Defines the email address of the webmaster of this feed. |
- Previous Page RSS Syntax
- Next Page RSS <item>