1 entry tagged rss, xml, and xmlns

Version numbers in namespaces considered harmful

The various flavours of RSS offer a variety of namespace requirements:

URL RSS version
http://my.netscape.com/rdf/simple/0.9/ 0.9
(default) 0.91, 0.92, 0.94
http://purl.org/rss/1.0/
http://purl.org/rss/1.0/modules/rss091#
1.0
http://backend.userland.com/rss2 2.0

In my opinion, it is a grave mistake to include a version number in a namespace URI. The function of a namespace is to prevent accidental collisions between names defined by different people (or organizations) when two XML vocabularies are combined in one document. The version number of the format can be specified separately (as indeed all the RSS versions do, as an attribute of their root element). If the 0.9 spec had only used http://netscape.com/1999/rss as its namespace (following the lead of http://www.w3.org/1999/xhtml) then all the versions could have used the same namespace.

Why do I care, you ask? Because if you use actual XML tools like XSLT to manipulate RSS feeds, then the fact that there are three or four namespaces in use for essentially the same elements makes the whole thing more complicated. Where I might have had

<xsl:template match="/rss:rss/rss:channel">...

I better be prepared for more complicated expressions like

<xsl:template match="/*/*[lname()=channel]">...

(to allow for any root element, and to ignore the namespace of the channel element). This clutters the XSLT file and makes it harder to maintain—and probably also less efficient. Sigh.

This is not unique to RSS, by the way—I had all sorts of hassle with early ve4sions of SVG tools which were caught out by the ever-changing SVG namespace URL. They finally settled on the quite-sane http://www.w3.org/2000/svg.