(For RSS weenies only). Sam Ruby thoughtfully pointed me at the RSS Validator, which whined at me that my RSS was broken, which it was, so I fixed it, so if your feed reader is showing everything here unread that may be why. Except for I'm resisting one change that the validator wants.

First of all, it wanted all the timestamps to be per RFC 822, which they weren't but they now are. (Hint to programmers: the right format string for strftime() is %a, %d %b %G %T %Z).

It's also complaining that I have relative URI references (from one place in ongoing to another), which I do, for example:

<a href="/ongoing/When/200x/2002/09/10/Snowstorm">...

Using relative URIs like this is good practice IMHO, the client knows where it got the RSS feed from, so it knows the base URI, so it should be able to absolutize it.

Hrumph; I see that indeed, NetNewsWire doesn't handle the relative references correctly; it tries, but puts the base and relative parts together wrong. Feels like a bug to me; what am I missing?

Well, let's think this through by way of example. Suppose an RSS feed is found at http://example.com/meta/x.rss, and it contains (omitting uninteresting elements):

1. <rss><channel><link>/site/</link>
2.  <item>
3.   <title>Whatever</title>
4.   <link>/content/whatever.html</link>
5.   <description>A &lt;a href="other.html">pointer</a>.
6.     </description>
7.   </item>
8.  </channel>
9. </rss>

It seems to me that the base URI for this thing is http://example.com/meta/x.rss, and that should be the base URI for further processing. So when it sees line 1, it should construct the absolute reference http://example.com/site/.

Then, when it sees the item link on line 4, it should construct the absolute URI http://example.com/content/whatever.html, and that should become the base URI for this item. Thus, when it encounters the link embedded in the description at line 5, that should point to http://example.com/content/other.html.

The above is more compact, more portable, and requires less code to generate than making all the URIs absolute, especially if the site's author (correctly) makes heavy use of relative URIs internally.

OK, OK, sometimes it's more important to be standard than to be right, so if RSS readers have been designed with the assumption that there will be no relative links, well, that's what we should generate.

But it really smells funny to me, architecturally.


author · Dad
colophon · rights
picture of the day
March 03, 2003
· Technology (90 fragments)
· · Web (396 more)

By .

The opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.

I’m on Mastodon!