Anne van Kesteren

Namespaces are optional

Tell me, is the following XML document well-formed:


If you are someone not interested in namespaces, you can say it is well-formed. Both XML 1 and XML 1.1 allow : as a valid character. However, if you like namespaces, using : would make the document ill-formed.

It bugs me why the WG did not remove : as a valid character when they moved to XML 1.1 among other backwards incompatible changes they made. If there is ever coming a new version of XML it should be complete.


  1. Tim Bray doesn't think there'll be another version of XML:

    We basically lied and told the world, we would do all that stuff in version 2. You have to shoot the engineers and ship at some point, right? I think there will never be an XML version 2. There is an XML version 1.1, but it’s controversial and not widely supported.

    Posted by Jim Dabell at

  2. I think they didn’t invalidate the : character, because otherwise the DOM1 methods would be useless in prefixed context.


    Posted by Laurens Holst at

  3. Either way, the document is well-formed. Namespace constraints are not WF constraints. The 1.1 version of the NS spec says a conforming document is namespace-well-formed, but that is different from well-formed.

    Posted by Henri Sivonen at

  4. I read that, but I wondered if it was important enough to make that distinction here. (Probably, for the matter of completeness.) Also, a namespace-ill-formed document is treated similar to an ill-formed document for namespace aware parsers and so are namespace-well-formed documents treated similar to well-formed documents in the same parsers.

    Posted by Anne at