Saturday, 21 May 2005
XML Base: Evil?
If you accept that QNames in content are evil, the next logical question is whether XML Base is any better. In fact, if you turn your head a certain way, it appears that there’s very little difference between a default namespace and XML Base.
Why? XML Base requires someone to know when element or attribute content is a URI, because it has to be applied to them before they can be used. This leaves you in an uncomfortable spot; either the XML processor has to have type information, or the application can’t be given isolated parts of the document without the in-scope base URI.
I think, however, that XML base is significantly better, because intermediate processors don’t have license to change the syntactic form, as they do with prefixes in QNames. Also, it’s much simpler to pass a single, unchanging Base URI around when you subset a document, rather than a set of prefix/URI mappings. So, no — XML Base is not evil. Maybe a little cheeky, but not the fruit of the devil.