Wrox Home  
Search
Beginning RSS and Atom Programming
by Danny Ayers, Andrew Watt
May 2005, Paperback


An Example RSS 2.0 Document

Having looked at the individual parts of the document structure of an RSS 2.0 document, you can now take a look at a sample RSS 2.0 document that happens to contain my first author blog post on Wrox.com.

<?xml version="1.0" ?> 
<rss version="2.0">
<channel>
<title>Wrox P2P Blogs - Andrew Watt</title> 
<ttl>60</ttl> 
<description>Wrox.com P2P Community Blogs</description> 
<link>http://p2p.wrox.com/blogs_author.asp?AUTHOR_ID=22322</link> 
<copyright>Copyright (c) 2000-2004 by 
John Wiley & Sons, Inc. or related companies.
 All rights reserved.</copyright> 
<language>en</language> 
<image>
 <url>http://p2p.wrox.com/images/p2p/wrox_rss_logo.gif</url> 
 <title>Wrox P2P Blogs - Andrew Watt</title> 
 <link>http://p2p.wrox.com/blogs_author.asp?AUTHOR_ID=22322</link> 
 <width>36</width> 
 <height>31</height> 
</image>
<item>
<title>Firefox 1.0 is available</title> 
<description>Firefox 1.0 is available now for download from <a 
href="http://www.mozilla.org" target="_blank">
<a href="http://www.mozilla.org" 
target="_blank">http://www.mozilla.org</a>
</a>.<br /><br />It downloaded quickly 
for me, although that could change as the servers 
get busier, and it installed smoothly. <br />
<br />If you haven't already spotted the new 
functionality to add a live RSS or Atom feed to your Firefox 
bookmarks using the button at the extreme bottom 
right of the Firefox window give it a go....</description> 
<pubDate>Tue, 9 Nov 2004 12:01:11 GMT</pubDate> 
<link>http://p2p.wrox.com/blog.asp?BLOG_ID=37</link> 
<comments>http://p2p.wrox.com/blogs_comments.asp?BLOG_ID=37</comments> 
</item>
</channel>
</rss>

The example document contains only one item and it does not use all of the many optional elements that the RSS 2.0 specification allows. Hopefully, it will give you an impression of what a simple RSS 2.0 document is like.

RSS 2.0 Extensions

The RSS 2.0 specification does not say much about extensions. All extension elements must be in a namespace (all RSS 2.0 elements are in no namespace). It is not clearly specified that extension elements can be inserted anywhere in an RSS 2.0 information feed document, but this seems to be the most likely meaning of the specification.

The blogChannel RSS Module

In the month following the release of the RSS 2.0 specification, Dave Winer issued a document relating to the blogChannel RSS module. The document is located at http://backend.userland.com/blogChannelModule. It is intended to relate to the context of a blog which has an associated information feed.

A typical namespace declaration for the blogChannel namespace is:

xmlns:blogChannel="http://backend.userland.com/blogChannelModule" 

The following elements are in the blogChannel module:

  • blink: This contains a URL that links to a blog that the author of the information feed wants to promote in some way.
  • blogRoll: This contains a URL that specifies the location of an OPML (Outline Processor Markup Language) file containing the blogroll for the information feed.
  • changes: This contains a URL that specifies the location of a changes.xml file. The idea behind the changes file is that bandwidth use may be reduced.
  • mySubscriptions: This contains a URL that specifies the location of an OPML file containing the subscriptions of the blog author.
OPML, Outline Processor Markup Language, is an XML language that can express the structure of an outline. In the context of information feeds, an OPML document is often used to contain a list of information feeds to which a blogger subscribes, the so-called blogroll.

Whether or not an extension module is supported can vary from one aggregator tool to another. A quasi-official list of RSS 2.0 extensions. Examples include Danny Ayer's Simple Semantic Resolution module and Joe Gregorio's Comment API.

Andrew Watt is an independent consultant and computer book author with an interest and expertise in various XML technologies. Currently, he is focusing primarily on the use of XML in Microsoft technologies. He is a Microsoft Most Valuable Professional for Microsoft InfoPath 2003. This article is excerpted from Chapter 12, "RSS 2.0: Really Simple Syndication," of the book Beginning RSS and Atom Programming, which Andrew co-authored with Danny Ayers.