Namespaces and RSS2.0

by Charles Miller on June 29, 2003

Bill de hÓra on Namespaces in RSS

Such tags are called children for a reason, they belong with their parents. It's this kind of noddy example that perpetuates the myth that namespaces are somehow neccessary for XML in the same way <getStockQuote /> perpetuates the myth that RPC is somehow neccessary for SOAP. They're not.

...

Using namespaces, it seems you can dodge name clashes. I'm saying, when you're ready, you won't have to.

In a programming language, you don't need namespaces when all the libraries you use are from the same vendor. When you're writing a Java application for internal use, it doesn't matter that you ignore the domain-name based package naming scheme: just so long as you don't release your code into the public, you'll never see a clash.

The problem that Namespaces were introduced into RSS to solve was: lots of different people want to add their own custom extensions to RSS. Since RSS is such a small domain, the chances of two people coming up with identical tags with different semantics is actually quite high. It's unlikely that you'll have two completely different definitions of "banking". It's very likely you'll have two different <lastUpdated> tags, one taking an RFC-822 date, and the other taking the number of seconds since the epoch.

There are two ways to solve this. One is that you have some central authority with whom to register extensions, who ensures that everyone plays nicely with each other. For RSS, that central authority would have to be Dave Winer. This kind of centralised authority didn't sit well with the RSS community, which wanted the ability to go off in different directions without permission.

The other is with namespaces. Namespaces are defined by URI, so their uniqueness is ensured in the same way as Java package names.

So yes, if you have full control over the schema, namespaces are unnecessary. If you have lots of people trying different things without deferring to a central authority, namespaces are necessary to stop them stepping on each others toes.

Of course, Dave Winer pretty much screwed the pooch with RSS2.0 and Namespaces, because he didn't really understand the ramifications. He felt pushed to allow namespaces in RSS, but really didn't get them. As such, he ceded all control over what could, or could not be in a valid RSS feed: even to the point where according to the spec, it's perfectly valid to replace an optional element (say, <pubDate>) from the core RSS with a namespaced tag from some other specification (say, <dc:date>).

This pretty much killed RSS as a standard, because almost all of it was optional, and you could add anything you wanted to it, and it would still have perfectly valid RSS. Hence the push to build something else from the ground up.

Previously: Gratuitous Microsoft Bashing

Next: Joel Spolsky is right again