Atom Feeds

Volume 7, Issue 13; 20 Jan 2004; last modified 08 Oct 2010

I spent some time last after dinner hacking Atom support into my blog infrastructure.

When you see something that is technically sweet, you go ahead and do it and you argue about what to do about it only after you have had your technical success. That is the way it was with the atomic bomb.

Julius Robert Oppenheimer

I spent some time last after dinner hacking Atom support into my blog infrastructure. They’re valid according to the schema I cooked up for Atom V0.3, but I welcome user experience. (Bloglines, for example, definitely has issues with them.)

I plan to track the Atom spec as it evolves.

The most interesting bit of infrastructure to build was the atom:id element. I chose URNs because, well, because I was an editor of RFC 3151, mostly.

The ID for this entry is

urn:publicid:%2B:IDN+norman.walsh.name:
DOCUMENT+007,013+Atom+Feeds:EN

(without the linefeed). Kind of long, but I don’t think that’s really an issue.

The hardest bit to build was the atom:modified element:

The content of an atom:modified element SHOULD have a time zone whose value MUST be “UTC”.

Must be UTC? Getting from the local time to UTC in XSLT is non-trivial. Predicatably, Jeni Tennison did most of the heavy lifting for us. Thanks, Jeni! I’m sure my code wouldn’t work for all the possible representations of the local time zone, but I think it works for the “hour-offset” format that date:date-time() actually returns.

The “main” feed, the feed of new essays, is http://norman.walsh.name/atom/whatsnew.xml. That’s the one I’m pointing to with the feed autodiscovery link on the home page. You can get to the others from the topics page.

Apropos of the recent discussions about MIME types, I’m serving these as “application/xml” (and not “application/atom+xml”) because Mozilla (and presumably IE) are willing to style the former with XSL and not the latter.

Comments

atom:id is defined as being a feed constant, rather than an entry id?

http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.4.8

—Posted by Dave Pawson on 23 Jan 2004 @ 08:05 UTC #

Ah, thanks. I am generating unique atom:id elements for each entry, but I neglected to generate one for the feed as a whole. I'll fix that.

—Posted by Norman Walsh on 23 Jan 2004 @ 11:20 UTC #