Format Versions and Modules
Format Versions and Modules
There are a number of different versions of the RSS format in use today, but the main choices are RSS 1.0 and RSS 2.0. Each version has its benefits and drawbacks; RSS 2.0 is known for its simplicity, while RSS 1.0 is more extensible and fully specified. Both formats are XML-based and have the same basic structure.
There’s one more choice; Atom is an effort in the IETF (an Internet standards body) to come up with a well-documented, standard syndication format. Although it has a different name, it has the same basic functions as RSS, and many people use the term “RSS” to refer to RSS or Atom syndication.
This section presents a quick overview of each; for more information, see their specifications and supporting materials.
RSS 2.0 is championed by UserLand’s Dave Winer. In this version, RSS stands for “Really Simple Syndication,” and simplicity is its focus.
This branch of RSS is based on RSS 0.91, which was first documented at Netscape and later refined by Userland.
Included in 2.0.1 - the latest stable version of this branch — are channel metadata like link, title, description; image, which allows you to specify a thumbnail image to display with the feed); webMaster and managingEditor, to identify who’s responsible for the feed, and lastBuildDate, which shows when the feed was last updated.
Items have the standard link, title and description metadata, as well as other, more experimental facilities like enclosure, which allows attachments to be automatically downloaded (don’t expect these features to be supported by all aggregators, however). Finally, items can have a guid element that identifies the item uniquely; this allows some advanced functionality in some aggregators.
Here’s an example of a minimal RSS 2.0 feed:
<?xml version="1.0"?> <rss version="2.0"> <channel> <title>Example Channel</title> <link>http://example.com/</link> <description>My example channel</description> <item> <title>News for September the Second</title> <link>http://example.com/2002/09/01</link> <description>other things happened today</description> </item> <item> <title>News for September the First</title> <link>http://example.com/2002/09/02</link> </item> </channel> </rss>
In the RSS 2.0 roadmap, Winer states that this branch is, for all practical purposes, frozen, except for clarifications to the specification.
However, exensions to the format are allowed in separate modules, using XML Namespaces to avoid conflicts in their names. For example, if you had an ISBN module to track books, it might look like this;
<item xmlns:book="http://namespace.example.com/book/1.0" rdf:about="http://www.amazon.com/exec/obidos/tg/detail/-/0553575376"> <title>Excession</link> <link>http://www.amazon.com/exec/obidos/tg/detail/-/0553575376</link> <book:isbn>0553575376</book:isbn> </item>
Generally, though, you should look for available RSS Modules, rather than defining your own, unless you’re sure that what you need doesn’t exist.
RSS 1.0 stands for “RDF Site Summary.” This flavor of RSS incorporates RDF, a Web standard for metadata. Because RSS 1.0 uses RDF, any RDF processor can understand RSS without knowing anything about it in particular. This allows syndicated feeds to easily become part of the Semantic Web.
RSS 1.0 also uses XML Namespaces to allow extensions, in a manner similar to RSS 2.0.
RSS 1.0 feeds look very similar to RSS 2.0 feeds, with a few key differences;
The entire feed is wrapped in <rdf:RDF> … </rdf:RDF> elements (so that processors know that it’s RDF)
Each <item> has an rdf:about attribute that usually, but not always, matches the <link>; this assigns an identifier to each item
There’s an <items> element in the channel metadata that contains a list of items in the channel, so that RDF processors can keep track of the relationship between the items
Some metadata uses the rdf:resource attribute to carry links, instead of putting it inside the element.
RSS 1.0 is developed and maintained by an ad hoc group of interested people; see their Web site for more information about RSS 1.0 and RSS Modules. See below for an example of an RSS 1.0 feed.
Dublin Core Module
The most well-known example of an RSS 1.0 Module is the Dublin Core Module. The Dublin Core is a set of metadata developed by librarians and information scientists that standardizes a set of common metadata that is useful for describing documents, among other things. The Dublin Core Module uses these metadata to attach information to both feeds (in the channel metadata) and to individual items.
This module includes useful elements like dc:date, for associating dates with items, dc:subject, which can be useful for categorizing items or feeds, and dc:rights, for dictating the intellectual property rights associated with an item or a feed.
Here’s an example of a minimal RSS 1.0 feed that uses the Dublin Core Module:
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" > <channel rdf:about="http://example.com/news.rss"> <title>Example Channel</title> <link>http://example.com/</link> <description>My example channel</description> <items> <rdf:Seq> <rdf:li resource="http://example.com/2002/09/01/"/> <rdf:li resource="http://example.com/2002/09/02/"/> </rdf:Seq> </items> </channel> <item rdf:about="http://example.com/2002/09/01/"> <title>News for September the First</title> <link>http://example.com/2002/09/01/</link> <description>other things happened today</description> <dc:date>2002-09-01</dc:date> </item> <item rdf:about="http://example.com/2002/09/02/"> <title>News for September the Second</title> <link>http://example.com/2002/09/02/</link> <dc:date>2002-09-02</dc:date> </item> </rdf:RDF>
As you can see, RSS 1.0 is a bit more verbose than 2.0, mostly because it needs to be compatible with other versions of RSS while containing the markup that RDF processors need.
Both RSS 1.0 and 2.0 are informal specifications; that is, they aren’t published by a well-known standards body or industry consortium, but instead by a small group of people.
Some people are concerned by this, because such specifications can be changed at the whim of the people who control it. Standards bodies bring stability, by limiting change and having well-established procedures for introducing it. To introduce such stability to syndication, a group of people established an IETF Working Group to standardise a format called Atom.
Atom is functionally similar to both branches of RSS, and is also an XML-based format.
<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>Example Feed</title> <link href="http://example.org/"/> <updated>2003-12-13T18:30:02Z</updated> <author> <name>John Doe</name> </author> <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> <entry> <title>Atom-Powered Robots Run Amok</title> <link href="http://example.org/2003/12/13/atom03"/> <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <updated>2003-12-13T18:30:02Z</updated> <summary>Some text.</summary> </entry> </feed>
As you can see, Atom has a feed element that contains both the feed-level metadata as well as the entrys (analogous to RSS’ items), and entry can contain similar metadata, such as title, link, id (instead of RSS 1.0’s rdf:about or RSS 2.0’s guid), and a short textual summary (instead of RSS’ description).
Generally, Atom isn’t as widely supported as RSS 1.0 or 2.0 right now, because it’s relatively new. However, it should catch up quickly, because of the broad base of vendors supporting the standardisation effort.