[jdom-interest] Namespace issues, et al.

bob mcwhirter bob at werken.com
Sun Feb 23 12:40:14 PST 2003


> Default namespace declarations do not apply directly to attribute names; 

That's you quoting the spec.  Don't know how much clearer it could be.

<foo xmlns="http://foo.com/" cheese="gouda">
   <bar xmlns="http://bar.com/" cheese="cheeder"/>
   <baz cheese="swiss"/>
</foo>

In this case:

<foo> is in the http://foo.com/ namespace
<bar> is in the http://bar.com/ namespace
<baz> is in the http://foo.com/ namespace

All three @cheese attributes exist in the 'null' namespace, since they
have no prefix, even though the default prefix meanders between 
http://foo.com/ and http://bar.com/.

Heck, check Xerces-C, as I'm sure they're conformant to the spec and
will exhibit this behaviour also.

	-bob




More information about the jdom-interest mailing list