Abstract: This tutorial demonstrates how to write an Ajax-enabled RSS Reader using PHP
RSS is a widely used XML-based standard, used to exchange information between applications on the Internet. One of the great advantages of XML is that it is plain text, thus easily read by any application. RSS feeds can be viewed as plain text files, but it doesn't make much sense to use them like that, as they are meant to be read by specialized software that generates web content based on their data. In order to better understand RSS, we need to see what lies underneath the name; the RSS document structure, that is.
The RSS Document Structure
The first version of RSS was created in 1999. This is known as version 0.9. Since then it has evolved to the current 2.0.1 version, which has been frozen by the development community, as future development is expected to be done under a different name. A typical RSS feed might look like this:
<rss version="2.0">
<channel>
<title>CNN.com</title>
<link>http://www.example.org</link>
<description>A short description of this feed</description>
<language>en</language>
<pubDate>Fri, 11 Aug 200607:56:23 EDT</pubDate>
<item>
<title>Catchy Title</title>
<link>http://www.example.org/2005/11/catchy-title.html</link>
<description>
The description can hold any content you wish, including XHTML.
</description>
<pubDate> Fri, 11 Aug 200607:55:28 EDT</pubDate>
</item>
<item>
<title>Another Catchy Title</title>
<link>http://www.example.org/2005/11/another-catchy-title.html</link>
<description>
The description can hold any content you wish, including XHTML.
</description>
<pubDate> Fri, 11 Aug 200607:55:28 EDT</pubDate>
</item>
</chanel>
</rss>
The feed may contain any number of items, each item holding different news or blog entries or whatever content you wish to store.
Implementing the AJAX RSS Reader
In order for this exercise to function correctly, you need to enable XSL support in your PHP installation. In the exercise that will follow we will build our own AJAX-enabled RSS reader application. The main characteristics for the application are: