RSS Syntax

RSS Examples

RSS Examples

RSS Synyax
Previous Home Next
Here is the structure of an RSS 2.0
<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>...</title>
      <link>...</link>
      <description>...</description>
      
      <language>...</language>
      <rating>...</rating>
      <copyright>...</copyright>
      
      <pubDate>...</pubDate>
      <lastBuildDate>...</lastBuildDate>
      <generator>....</generator>
      
      <docs>...</docs>
      <cloud>...</cloud>
      <ttl>...</ttl>
      
      <managingEditor>...</managingEditor>
      <webMaster>...</webMaster>
      
      <skipHours>
         <hour>...</hour>
      </skipHours>
      
      <skipDays>
         <day>...</day>
      </skipDays>
      
      <image>
         <title>...</title>
         <url>...</url>
         <link>...</link>
         
         <width>...</width>
         <height>...</height>
         <description>...</description>
      </image>
      
      <item>
         <title>...</title>
         <link>...</link>
         <description>...</description>

         <author>....</author>
         <category>....</category>
         <comments>....</comments>

         <enclosure ..../>
         <guid>....</guid>
         <pubDate>....</pubDate>

         <source>....</source>
      </item>
      
      ......More item tags.....
      <textInput>
         <title>...</title>
         <description>...</description>
         <name>...</name>
         
         <link>...</link>
      </textInput>
   </channel>
</rss>

Note: All the tags are case sensitive and should be used carefully

XML Version Identifier

Syntax
<?xml version="1.0"?> or
<?xml version="1.0" encoding="[ encoding code here ]"?>

 

RSS Version Identifier

Syntax
<rss version="2.0">

Note: Both XML and RSS Version Identifier Required Always and exact.

Channel Tag

Every RSS2.0 File start with a channel

Syntax
<channel>

Channel Title

The <channel> tag is used to describe an RSS feed. Within the <channel> tag, the <item> tag is used for each item in the RSS feed. Both these tags have many required child tags:

  • <title> - sets the title of the RSS feed/item
  • link

  • <link> - specifies the URL where the RSS feed/item content can be found
  • Syntax

    <link>http://www.r4r.co.in</link>

    Description

  • <description> - sets a description for the RSS feed/item
  • Syntax
    <description>Your source for tutorials, references and manuals!</description>

    generator

  • <generator> - Specifies the program used to create your RSS feed.if the RSS feed is created using an automatic feed creator like myRSScreator than it is used.
  • Syntax
    <generator>Weblog Editor 2.0</generator>

    Language

  • <language> - Specifies the language your RSS feed is written in.
  • Syntax
    <language>[ language code here ]</language>

    TTL( Time To Live)

  • <ttl> - Specifies how many minutes your RSS feed can stay cached before it is refreshed (stands for Time To Live).
  • Syntax
    <ttl>100</ttl>

    category

  • <category> - Specifies a category for an entire RSS feed or for individual RSS items. This makes it possible for RSS feed readers to group your RSS feed or individual RSS items based on category.
  • Syntax
    <category>News Headline</category>

    Enclosure

  • <enclosure> - Specifies a media file to be included with an RSS item.
  • Syntax
    <enclosure url="http://www.r4r.co.in/rss/tutorial" length="243t367" type="Text" />

    Image

  • <image> - Specifies an image to be displayed together with a feed.
Syntax
<image>

Note :If Image is available than use these syntax

Syntax
<width>[ numeric value here ]</width>
<height>[ numeric value here ]</height>

RSS documents use a self-describing and simple syntax.

Here is a simple RSS document:
<?xml version="1.0" ?>
<rss version="2.0">
<channel>
  <title>Ajax and XUL</title>
  <link>http://www.xul.fr/en/</link>
  <description>XML graphical interface etc...</description>
  <image>
      <url>http://r4r.co.in/image.gif</url>
      <link>http://r4r.co.in/index.shtml</link>
  </image>
  <item>
      <title>News  of today</title>
      <link>http://r4r.co.in/en-xml-rss.shtml</link>
      <description>every thing which you want to add </description>
  </item>
  <item>
      <title>News of tomorrows</title>
      <link>http://r4r.co.in-rdf.shtml</link>
      <description>All about RDF</description>
    </item>
</channel>
</rss> 
Previous Home Next