[jdom-interest] Accessor methods and namespaces
bob mcwhirter
bob at werken.com
Sun Aug 11 16:59:16 PDT 2002
> So, are namespaces handled differently for attributes and elements, as
> far as default/none? Even if so, unless I'm really missing something, the
> attribute's namespace should have the same namespace as the element, so the
> getAttribute(String, Namespace) should have it it, even if it was redundant.
Yes, but that's XML, not JDOM.
<bar attr="value" xmlns="http://ns.org/">
Unprefexed element names -may- exist in the default namespace if
there is one.
Unprefixed attributes -always- exist in the 'no' or 'global' namespace.
If you want a namespaced attribute, you -must- give it a prefix. No
such thing as default namespaces for attributes.
-bob
More information about the jdom-interest
mailing list