RSS <channel> Element


The RSS <channel> element describes the RSS feed.


The RSS <channel> Element

Look at the following RSS document:

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">

<channel>
  <title>W3Schools Home Page</title>
  <link>http://www.w3schools.com</link>
  <description>Free web building tutorials</description>
  <item>
    <title>RSS Tutorial</title>
    <link>http://www.w3schools.com/rss</link>
    <description>New RSS tutorial on W3Schools</description>
  </item>
</channel>

</rss>

As mentioned before, the <channel> element describes the RSS feed, and has three required child elements:

  • <title> - Defines the title of the channel (e.g. W3Schools Home Page)
  • <link> - Defines the hyperlink to the channel (e.g. http://www.w3schools.com)
  • <description> - Describes the channel (e.g. Free web building tutorials)

The <channel> element usually contains one or more <item> elements. Each <item> element defines an article or "story" in the RSS feed.

Furthermore, there are several optional child elements of <channel>. We will explain the most important ones below.


The <category> Element

The <category> child element is used to specify a category for your feed.

The <category> element makes it possible for RSS aggregators to group sites based on category.

The category for the RSS document above could be:

<category>Web development</category>


The <copyright> Element

The <copyright> child element notifies about copyrighted material.

The copyright for the RSS document above could be:

<copyright>2006 Refsnes Data as. All rights reserved.</copyright>


The <image> Element

The <image> child element allows an image to be displayed when aggregators present a feed.

The <image> element has three required child elements:

  • <url> - Defines the URL to the image
  • <title> - Defines the text to display if the image could not be shown
  • <link> - Defines the hyperlink to the website that offers the channel

The image for the RSS document above could be:

<image>
  <url>http://www.w3schools.com/images/logo.gif</url>
  <title>W3Schools.com</title>
  <link>http://www.w3schools.com</link>
</image>


The <language> Element

The <language> child element is used to specify the language used to write your document.

The <language> element makes it possible for RSS aggregators to group sites based on language.

The language for the RSS document above could be:

<language>en-us</language>


RSS <channel> Reference

Element Description
<category> Optional. Defines one or more categories for the feed
<cloud> Optional. Register processes to be notified immediately of updates of the feed
<copyright> Optional. Notifies about copyrighted material
<description> Required. Describes the channel
<docs> Optional. Specifies a URL to the documentation of the format used in the feed
<generator> Optional. Specifies the program used to generate the feed
<image> Optional. Allows an image to be displayed when aggregators present a feed
<language> Optional. Specifies the language the feed is written in
<lastBuildDate> Optional. Defines the last-modified date of the content of the feed
<link> Required. Defines the hyperlink to the channel
<managingEditor> Optional. Defines the e-mail address to the editor of the content of the feed
<pubDate> Optional. Defines the last publication date for the content of the feed
<rating> Optional. The PICS rating of the feed
<skipDays> Optional. Specifies the days where aggregators should skip updating the feed
<skipHours> Optional. Specifies the hours where aggregators should skip updating the feed
<textInput> Optional. Specifies a text input field that should be displayed with the feed
<title> Required. Defines the title of the channel
<ttl> Optional. Specifies the number of minutes the feed can stay cached before refreshing it from the source
<webMaster> Optional. Defines the e-mail address to the webmaster of the feed


Color Picker

colorpicker