Experimenting with RSS 2.0

Assuming the RSS core is now frozen, Sam Ruby pointed out that version 2.0 makes the <fullitem> element in my feed bogus, and suggested I move it into the mod_content module, one of a series of modules designed for RSS 1.0. Good idea! Along with Rael Dornfest and others, I've always liked the idea of "RSS 0.9x-style simple XML syntax with room for expansion" [ 1] .

I was already using the alternate RSS writer callback mechanism , which Dave Winer provided a while ago, in order to override the default RSS writer and insert <fullitem>, an element containing the complete text of each blog item. This was a hack that has enabled me to maintain two feeds. In the first, the bogus <fullitem> was ignored by aggregators, but was transformed (by XSLT) into the <description> in the second feed. Meanwhile, back in the first feed, the <description> is truncated to just its first paragraph. That's done by means of another callback mechanism Dave added so those of us who write longer items needn't overwhelm those who read them in RSS aggregators.

The alternate RSS writer is a script I call myRssWriter, which lives in the table called user.radio.callbacks.writeRssFile. It is a wholesale replacement for the standard RSS writer, system.verbs.builtins.radio.weblog.writeRssFile. Originally I just cloned that script and made a few tweaks. Here were the additional tweaks I made tonight to create what will hopefully be a kosher 2.0 feed.

First, I changed this:

add ("<rss version=\"0.92\\">");

to this:

add ("<rss version=\"2.0\\" xmlns:content=\\"http://purl.org/rss/1.0/modules/content/\\" xmlns:dc=\\"http://purl.org/dc/elements/1.1/\\" >");

I'm actually invoking two modules here: the content module for my fullitem element, and the Dublin Core module for the date.

Then, I changed from:

add("<pubDate>" + date.netStandardString(adrpost^.when) + "</pubDate>");
add("<fullitem>" + fullitem + "</fullitem>");


add("<dc:date>" + date.netStandardString(adrpost^.when) + "</dc:date>");
add("<content:encoded>" + fullitem + "</content:encoded>");

The <dc:date> was, admittedly, gratuitous. I could have left <pubDate> alone, and in any case both are optional and not yet relied on by anyone so far as I know. But I've always liked the idea of Dubin Core metadata, so...onward!

Finally, there was an XSLT stylesheet to adjust. I use a transform of my default feed to produce my alternate long-descriptions feed . The stylesheet needed namespace declarations for <dc:> and <content:>.

Everything seems to check out. I unsubscribed and resubscribed my channels in Radio without any trouble. (Of course if any problems arise in other systems, please holler.) Should RSS readers ever start to care about <content:encoded> (or some equivalent), I can drop the second feed. In the best of all possible worlds, such readers would then offer users three choices based on the default feed:

  1. The full content of each item.

  2. The truncations suggested by the author of the feed.

  3. An alternate truncation performed on the full content by the RSS reader.

Meanwhile, both flavors are available as separate feeds that work with existing RSS readers.

Former URL: http://weblog.infoworld.com/udell/2002/09/07.html#a404