RSS core structure

RSS feeds are built using XML so remember to save your RSS files with the .xml extension.

Here is the core structure. Details follow below the code....

RSS core structure:
<?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"> <channel> <title>RSS feed title</title> <link>URL where RSS feed can be found</link> <description>RSS feed description</description> <item> <title>RSS item title</title> <link>URL where the item content can be found</link> <description>Description of the item</description> </item> <item> <title>......</title> <link>......</link> <description>......</description> </item> <item> <title>......</title> <link>......</link> <description>......</description> </item> </channel> </rss>

The first line is the XML declaration which specifies the XML version as well as the character encoding being used. The second line is the RSS declaration which specifies that this file is an RSS document, specifically RSS 2.0

The rest of the file is the five required RSS tags - <channel>, <title>, <link>, <description>, and <item>

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 three required child tags:

NOTE: Remember to keep in mind XML syntax rules when creating RSS feeds - All tags must have a closing tag, be in lowercase, and in the correct order. All attributes must be in lowercase and attribute values must be quoted.

© Copyright 2009-2010 Landofcode.com
Terms of use | Privacy policy | Copyright information