[jdom-interest] Syntax of namespace URIs

Michael Kay mike at saxonica.com
Thu Jan 6 06:01:15 PST 2005


I was looking at the JDOM code for validating a namespace URI
(Verifier#checkNamespaceURI).

It seems to accept any string so long as it doesn't start with a digit, a
dollar, or a hyphen.

Where does this rule come from? It doesn't seem to bear any resemblance to
anything in RFC2396.

If we adopt the notion that relative namespace URIs are disallowed, then the
URI has to start with a scheme name which has to start with an ASCII letter.

If on the other hand relative namespace URIs are allowed (they are legal
according to the namespaces REC, but not according to the InfoSet), then
names starting with a digit are fine.

I would have thought one should either allow any string (as most XML parsers
do, I believe), or one should apply the rules strictly. This code seems to
be a strange half-way-house.

Michael Kay



More information about the jdom-interest mailing list