[jdom-interest] Namespace help

bob mcwhirter bob at werken.com
Wed Jul 24 13:40:46 PDT 2002


> Now I don't know if this is a bug or FAD (feature as designed), but
> if the child namespace is null thus its URI is null, then this can be
> interpreted as the child implicitly inherits the parent's namespace
> (using elementFormDefault="qualified" attribute in the schema should
> be all it needs). But the current JDOM implementation pretty much says
> "null" is not the same as a specified parent namespace, thus I will print
> out this empty namespace URI even though xmlns="" looks really silly.

Elements are constructed outside of any context. 

If you create a <child> element, with no namespace, then it will continue
to have no namespace, no matter where it's inserted into a tree.

This is a feature, not a bug.

Bottom line: an Element always keeps the namespace it was constructed
with, even if that namespace was the null/empty namespace.

	-bob




More information about the jdom-interest mailing list