RSS and Atom in Action: Newsfeed Formats | Page 2 | WebReference

RSS and Atom in Action: Newsfeed Formats | Page 2

[previous] [next]

RSS and Atom in Action: Newsfeed Formats

4.1.2 The elements of RSS 0.91

The definitive source of information about RSS 0.91 is the specification itself, but for your convenience we have provided a summary diagram in figure 4.1. Each box in the diagram represents an XML element, and the arrows indicate containment. For example, the <rss> element contains the <channel> element, which contains <description>, <link>, <language>, and so on.

We saw the <rss>, <channel>, and <item> elements in listing 4.1, but some new elements here deserve mention:

  • <image>—This element allows a web site to specify an icon or logo image to be displayed when the newsfeed is displayed in a newsfeed reader or on another web site.
  • <lastbuilddate>—This element specifies the last time any item in the newsfeed changed.
  • <pubdate>—This element specifies the time that the newsfeed was last published, using RFC 822 date format. Note that the channel itself has a publication date, but the individual items in the newsfeed do not. That's a serious limitation for applications that rely on item dates to sort items (such as the group aggregator example presented in chapter 11).
  • <textinput>—Another rarely used element, <textinput> offers a way for a publisher to allow a reader to query the publisher's web site.
  • <skipdays> and <skiphours>—These elements allow publishers to specify the times during which a newsfeed is unlikely to be updated. Most newsfeed readers ignore these values.

Let's get back to our history lesson, picking up the story with RSS 1.0.

The XML elements that make up RSS 0.91

4.2 The RDF fork: RSS 1.0

RSS 0.91 was clearly useful, but just about everybody agreed that it needed some improvement and additional metadata. Unfortunately, the RSS user and developer community was divided about how RSS should be improved. A group of RDF advocates wanted to bring the full power of RDF back into RSS. Dave Winer, on the other hand, wanted to keep RSS as simple as possible. The two sides did not get along well and eventually, in December 2000, the RDF advocates released what they called RSS 1.0—a new version of RSS with RDF back in the mix and with support for extension modules.

RSS 1.0 was well received. It was adopted by the popular Movable Type blogging system and as a result is still in widespread use. Let's take a close look at it, starting with the sample RSS 1.0 newsfeed shown in listing 4.2. This feed is taken from the specification itself. Some optional elements have been removed for the sake of brevity.

Listing 4.2 Example of an RSS 1.0 format newsfeed

The first thing to note is that the newsfeed is an RDF document [line 2]. Next, notice that the containment hierarchy is different from that of earlier forms of RSS. The <item> elements are not contained within the <channel> element [line 5]. The channel is essentially the header for the file. It contains the <title> [line 6], <link> [line 7], and <description> [line 9] of the newsfeed, as well as an RDF-style table of contents [line 13] that lists the items in the newsfeed.

Each <item> contains the same <title>, <link>, and <description> elements as in previous versions of RSS, except that the item permalink is specified twice—once in the rdf:about attribute [line 19] and once in the <link> element [line 21]. Note that an item-level element is still not part of the format, but it is common practice for RSS 1.0 newsfeeds to include the Dublin Core extension module and a <dc:date> element in each item. We'll show you how to do that in section 4.2.2.

[previous] [next]