2005-12-14

Sisters of Transparency

Posted in Uncategorized at 10:31 pm by Liam Quin

Oh dear, this blogging thing doesn’t happen all by itself, you have to remember it.

I had originally wanted somewhere I could write about some of the philosophy and design issues of XML, but then I got intimidated, because people could see what I wrote. What if they read things into my writing that I didn’t intend?

I suppose that’s a bit like an XML document: people can read all sorts of meaning into my markup, and it’s just fine as long as they don’t go round asserting that I meant whatever it is they have inferred.

People sometimes talk about URIs as being opaque. Just because a URI ends in /liam/pictures/me/ doesn’t mean that you can assume it’s a resource associated with pictures of Liam. If it’s an http resource, you can assume that you can take /pictures/ off the end, although you don’t know anything about what you’ll get. You are simply resolving a URI of ../ against the given base URI, and that’s perfectly well defined.

So there are some things you know and some things you can guess, but the things you can guess are only ever guesses unless you have information from some other source. For example, you might dereference a URI and get an HTML document (/pictures/liam/me) that says this page is pictures of Milldeton Englebert, M.E. and then you know that me isn’t about Liam at all. Or not.

In the same way, XML namespaces are opaque. You can handle the syntax: a qualified name (qname) has a URI binding and a local name, and the URI binding is referenced via a prefix: xyzzy:room. The prefix itself (xyzzy) is defined to be meaningless except as a binding. This shows the syntax is poorly defined, but we were in a hurry at the time. It would have been better to have taken longer, in retrospect, but we did what we did. XML tools can and do rewrite prefixes. The local name part (room) is opaque just like a component of a hierarchical URI is opaque: you know only what the owner chooses to document, and no more.

Amongst other things this means you might think that it’s wrong to hang behaviour such as rendering or scripting off local element names. In fact you can use XML documents in any way you like, and indeed it’s common to use a single piece of markup in multiple and radically different ways. So go ahead and use any XML document you find in any way you like, subject to rules of copyright, libel, slander and aesthetic taste. But don’t go around saying you know the only way to process that XML: even its owner doesn’t know that. You can say you are the owner, creator, designer and mother of the data, and that you intended a particular usage, and that may be very helpful.

Your sister in XML,

Liam