Voice RSS Logo
 
Voice RSS Home Voice RSS Contacts Voice RSS Site Map Login  

Follow VoiceRSS on LinkedIn Follow VoiceRSS on Facebook Follow VoiceRSS on Twitter  
 
 

RSS Specifications

How RSS Works

RSS is used to share content between websites. With RSS, you register your content with companies called aggregators.

So, to be a part of it: First, create an RSS document and save it with an .xml extension. Then, upload the file to your website. Next, register with an RSS aggregator. Each day the aggregator searches the registered websites for RSS documents, verifies the link, and displays information about the feed so clients can link to documents that interest them.

RSS Syntax

The syntax rules of RSS 2.0 are very simple and very strict. RSS is dialect of XML. All RSS files must conform to the XML 1.0 specification, as published on the World Wide Web Consortium (W3C) website.

At the top level, a RSS document is a <rss> element, with a mandatory attribute called version, that specifies the version of RSS that the document conforms to. If it conforms to this specification, the version attribute must be 2.0.

Subordinate to the <rss> element is a single <channel> element, which contains information about the channel (metadata) and its contents.

RSS Example

RSS documents use a self-describing and simple syntax.

Here is sample file for RSS 2.0. Note that the sample files may point to documents and services that no longer exist.

Here is a simple RSS document:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<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>
        <item>
            <title>XML Tutorial</title>
            <link>http://www.w3schools.com/xml</link>
            <description>New XML tutorial on W3Schools</description>
        </item>
    </channel>
</rss>

The first line in the document - the XML declaration - defines the XML version and the character encoding used in the document. In this case the document conforms to the XML 1.0 specification and uses the ISO-8859-1 (Latin-1/West European) character set.

The next line is the RSS declaration which identifies that this is an RSS document (in this case, RSS version 2.0).

The next line contains the <channel> element. This element is used to describe the RSS feed.

The <channel> element 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)

Each <channel> element can have one or more <item> elements.

Each <item> element defines an article or "story" in the RSS feed.

The <item> element has three required child elements:
• <title> - Defines the title of the item (e.g. RSS Tutorial)
• <link> - Defines the hyperlink to the item (e.g. http://www.w3schools.com/rss)
• <description> - Describes the item (e.g. New RSS tutorial on W3Schools)

Finally, the two last lines close the <channel> and <rss> elements.

Comments in RSS

The syntax for writing comments in RSS is similar to that of HTML:

<!-- This is an RSS comment -->


RSS is Written in XML

Because RSS is XML, keep in mind that:
• All elements must have a closing tag
• Elements are case sensitive
• Elements must be properly nested
• Attribute values must always be quoted

RSS Reference

RSS <channel> Element

Look at the following RSS document:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<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 following table provides list of child elements under <channel> element. The links in the "Element" column point to more information about each specific element.

Element Description Example
<category> Optional. Defines one or more categories for the feed <category>Newspapers</category>
<cloud> Optional. Register processes to be notified immediately of updates of the feed. Attribute protocol allows the following values: SOAP, HTTP-POST, XML-RPC <cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="pingMe" protocol="soap" />
<copyright> Optional. Notifies about copyrighted material <copyright>Copyright 2010, VoiceRSS</copyright>
<description> Required. Describes the channel <description>The latest news from VoiceRSS.org.</description>
<docs> Optional. Specifies an URL to the documentation of the format used in the feed <docs>http://www.voicerss.org/rss/</docs>
<generator> Optional. Specifies the program used to generate the feed <generator>Absolute RSS Editor 1.12</generator>
<image> Optional. Allows an image to be displayed when aggregators present a feed <image>
    <url>http://www.w3schools.com/images/logo.gif</url>
    <title>W3Schools.com</title>
    <link>http://www.w3schools.com</link>
</image>
<language> Optional. Specifies the language the feed is written in <language>en-us</language>
<lastBuildDate> Optional. Defines the last-modified date of the content of the feed <lastBuildDate>Sat, 07 Sep 2002 09:42:31 GMT</lastBuildDate>
<link> Required. Defines the hyperlink to the channel <link>http://www.w3schools.com/xml</link>
<managingEditor> Optional. Defines the e-mail address to the editor of the content of the feed <managingEditor>rss.support@voicerss.org</managingEditor>
<pubDate> Optional. Defines the last publication date for the content of the feed <pubDate>Sat, 07 Sep 2002 09:42:31 GMT</pubDate>
<rating> Optional. The PICS rating of the feed  
<skipDays> Optional. Specifies the days where aggregators should skip updating the feed <skipDays>
    <day>Saturday</day>
    <day>Sunday</day>
</skipDays>
<skipHours> Optional. Specifies the hours where aggregators should skip updating the feed <skipHours>
    <hour>0</hour>
    <hour>1</hour>
    <hour>22</hour>
    <hour>23</hour>
</skipHours>
<textInput> Optional. Specifies a text input field that should be displayed with the feed <textinput>
    <description>Search Google</description>
    <title>Search</title>
    <link>http://www.google.no/search?</link>
    <name>q</name>
</textinput>
<title> Required. Defines the title of the channel <title>RSS News</title>
<ttl> Optional. Specifies the number of minutes the feed can stay cached before refreshing it from the source <ttl>60</ttl>
<webMaster> Optional. Defines the e-mail address to the webmaster of the feed <webMaster>webmaster@voicerss.org</webMaster>

RSS <item> Element

As mentioned before, each <item> element defines an article or "story" in the RSS feed.

The <item> element has three required child elements:
• <title> - Defines the title of the item (e.g. RSS Tutorial)
• <link> - Defines the hyperlink to the item (e.g. http://www.w3schools.com/rss)
• <description> - Describes the item (e.g. New RSS tutorial on W3Schools)

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

The following table provides list of child elements under <item> element. The links in the "Element" column point to more information about each specific element.

Element Description Example
<author> Optional. Specifies the e-mail address to the author of the item <author>webmaster@voicerss.org</author>
<category> Optional. Defines one or more categories the item belongs to <category>Newspapers</category>
<comments> Optional. Allows an item to link to comments about that item <comments>http://www.w3schools.com/rss/comments.asp</comments>
<description> Required. Describes the item <description>The latest news from VoiceRSS.org.</description>
<enclosure> Optional. Allows a media file to be included with the item <enclosure url="http://www.w3schools.com/media/3d.wmv" length="78645" type="video/wmv" />
<guid> Optional. Defines a unique identifier for the item <guid>http://www.w3schools.com/rss/item0768</guid>
<link> Required. Defines the hyperlink to the item <link>http://www.w3schools.com/xml</link>
<pubDate> Optional. Defines the last-publication date for the item <pubDate>Sat, 07 Sep 2002 09:42:31 GMT</pubDate>
<source> Optional. Specifies a third-party source for the item <source url="http://www.w3schools.com">W3Schools.com</source>
<title> Required. Defines the title of the item <title>Hot News</title>

RSS <category> Element

The <category> element specifies one or more categories the channel or item belongs to. The <category> element can also specify the hierarchic location in a category (the value of the <category> element is then a forward-slash separated string).

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

Attributes

Tag Description
domain Optional. A string or URL that identifies a categorization taxonomy.

Example:
<category domain="syndic8">IT</category>

RSS <cloud> Element

The <cloud> element is used to register processes with a cloud to be notified immediately of updates of the channel.

RSS <copyright> Element

The <copyright> element is used to notify about copyrighted material.

RSS <description> Element

The <description> element describes the channel or item.

RSS <docs> Element

The <docs> element specifies an URL to the documentation of the format used in the RSS document.

RSS <generator> Element

The <generator> element specifies the program used to generate the RSS feed.

RSS <image> Element

The <image> element allows an image to be displayed when aggregators present a feed. The image must be of type GIF, JPEG or PNG.

Child Elements of <image>

Tag Description
<description> Optional. Specifies the text in the HTML title attribute of the link around the image
<height> Optional. Defines the height of the image. Default is 31. Maximum value is 400
<link> Required. Defines the hyperlink to the website that offers the channel
<title> Required. Defines the text to display if the image could not be shown
<url> Required. Specifies the URL to the image
<width> Optional. Defines the width of the image. Default is 88. Maximum value is 144

RSS <language> Element

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

Standard language-codes

Language Identifier Language Identifier
Afrikaans af Albanian sq
Basque eu Belarusian be
Bulgarian bg Catalan ca
Chinese (Simplified) zh-cn Chinese (Traditional) zh-tw
Croatian hr Czech cs
Danish da Dutch nl
Dutch (Belgium) nl-be Dutch (Netherlands) nl-nl
English en English (Australia) en-au
English (Belize) en-bz English (Canada) en-ca
English (Ireland) en-ie English (Jamaica) en-jm
English (New Zealand) en-nz English (Phillipines) en-ph
English (South Africa) en-za English (Trinidad) en-tt
English (United Kingdom) en-gb English (United States) en-us
English (Zimbabwe) en-zw Estonian et
Faeroese fo Finnish fi
French fr French (Belgium) fr-be
French (Canada) fr-ca French (France) fr-fr
French (Luxembourg) fr-lu French (Monaco) fr-mc
French (Switzerland) fr-ch Galician gl
Gaelic gd German de
German (Austria) de-at German (Germany) de-de
German (Liechtenstein) de-li German (Luxembourg) de-lu
German (Switzerland) de-ch Greek el
Hawaiian haw Hungarian hu
Icelandic is Indonesian in
Irish ga Italian it
Italian (Italy) it-it Italian (Switzerland) it-ch
Japanese ja Korean ko
Macedonian mk Norwegian no
Polish pl Portuguese pt
Portuguese (Brazil) pt-br Portuguese (Portugal) pt-pt
Romanian ro Romanian (Moldova) ro-mo
Romanian (Romania) ro-ro Russian ru
Russian (Moldova) ru-mo Russian (Russia) ru-ru
Serbian sr Slovak sk
Slovenian sl Spanish es
Spanish (Argentina) es-ar Spanish (Bolivia) es-bo
Spanish (Chile) es-cl Spanish (Colombia) es-co
Spanish (Costa Rica) es-cr Spanish (Dominican Republic) es-do
Spanish (Ecuador) es-ec Spanish (El Salvador) es-sv
Spanish (Guatemala) es-gt Spanish (Honduras) es-hn
Spanish (Mexico) es-mx Spanish (Nicaragua) es-ni
Spanish (Panama) es-pa Spanish (Paraguay) es-py
Spanish (Peru) es-pe Spanish (Puerto Rico) es-pr
Spanish (Spain) es-es Spanish (Uruguay) es-uy
Spanish (Venezuela) es-ve Swedish sv
Swedish (Finland) sv-fi Swedish (Sweden) sv-se
Turkish tr Ukranian uk

RSS <lastBuildDate> Element

The <lastBuildDate> element defines the last-modified date of the content of the RSS feed.

RSS <link> Element

The <link> element defines the hyperlink to the channel or item

RSS <managingEditor> Element

The <managingEditor> element is used to specify an e-mail address for the editor of the content of the RSS feed.

RSS <pubDate> Element

The <pubDate> element defines the last publication date for the content in the channel or item.

RSS <rating> Element

The <rating> element describes the parental control rating of the RSS feed. The rating standard used is W3C`s PICS

RSS <skipDays> Element

The <skipDays> element specifies the days where aggregators should skip updating the RSS feed.

Child Elements of <skipDays>

Tag Description
<day> Optional. Specifies the days where aggregators should skip updating the RSS feed

Example:
<day>Saturday</day>
<day>Sunday</day>

There can be up to seven <day> elements within the <skipDays> element.

RSS <skipHours> Element

The <skipHours> element specifies the hours where aggregators should skip updating the RSS feed.

Child Elements of <skipHours>

Tag Description
<hour> Optional. Specifies the hours where aggregators should skip updating the RSS feed

Example:
<hour>0</hour>
<hour>1</hour>
<hour>2</hour>
<hour>3</hour>
<hour>4</hour>
<hour>5</hour>
<hour>6</hour>
<hour>7</hour>
<hour>17</hour>
<hour>18</hour>
<hour>19</hour>
<hour>20</hour>
<hour>21</hour>
<hour>22</hour>
<hour>23</hour>

There can be up to 24 <hour> elements within the <skipHours> element. 0 represents midnight.

RSS <textInput> Element

The <textInput> element specifies a text input field that should be displayed with the RSS feed.

Child Elements of <textInput>

Tag Description
<description> Required. Defines a description of the text input area
<name> Required. Defines the name of the text object in the text input area
<link> Required. Defines the URL of the CGI script that processes the text input
<title> Required. Defines the label of the submit button in the text input area

Most aggregators ignores the <textInput> element.

RSS <title> Element

The <title> element defines the title of the channel or item

RSS <ttl> Element

The <ttl> (ttl=time to live) element specifies the number of minutes the feed can stay cached before refreshing it from the source.

RSS <webMaster> Element

The <webMaster> element defines the e-mail address to the webmaster of the RSS feed.

RSS <author> Element

The <author> element is used to specify the e-mail address of the author of the item.

RSS <comments> Element

The <comments> element allows an item to link to comments about that item.

RSS <enclosure> Element

The <enclosure> element allows a media-file to be included with an item.

Attributes

Tag Description
length Required. Defines the length (in bytes) of the media file
type Required. Defines the type of media file
url Required. Defines the URL to the media file

RSS <guid> Element

The <guid> element defines a unique identifier for the item. Aggregators must view the guid as a string. There are no rules for the syntax. It's up to the creator of the RSS document, to establish the uniqueness of the string.

Attributes

Tag Description
isPermaLink Optional. If set to true, the reader may assume that it is a permalink to the item (a url that points to the full item described by the <item> element). The default value is true. If set to false, the guid may not be assumed to be a url

RSS <source> Element

The <source> element specifies a third-party source for the item.

Attributes

Tag Description
url Required. Specifies the link to the source

Used materials:
http://feed2.w3.org/docs/rss2.html
http://www.w3schools.com/rss