Home » XML Basics » 07 - RSS
7

XML with RSS

The integration of XML and RSS will be discussed in this section of the XML chapter.

The first line of your XML - RSS document must declare the XML type, in this case it is 1.0. Write the first line of code as you see below. Remember to close this tag later on.

 <?xml version="1.0"?>  

The second line of your XML - RSS document must declare the RSS type, use 2.0 for simplicity purposes. Write the line of code as you see below. Remember to close this tag later on.

 <rss version="2.0>  

The next lines of code in your XML - RSS document will be the channel. A channel follows the structure below.

 <channel>  <title> </title> <link> </link> <description> </description>  <item>  <title> </title> <link> </link> <description> </description>  </item>  <item>  <title> </title> <link> </link> <description> </description>  </item>  etcetera...  </channel>  

The channel has three elements, the title, link, and the description. The channel is basically used to describe the RSS feed that comes in from a specific website.

The items of the channel are the actual RSS feeds that come in. You can have as many items as you want.

Keep in mind that your XML - RSS file is still an XML document which means that you should always keep in mind case sensitivity, closing tags, and proper nesting.

BBC RSS

http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml is the XML - RSS hyperlink shown above.