[jdom-interest] Is JDOM dying?

Jason Hunter jhunter at servlets.com
Mon Mar 17 15:00:41 PST 2003


Malachi de AElfweald wrote:
> 
> Well, inherit and any don't really mean the same thing...
> 
> I see there being four possible meanings:
> new Element("foo", Namespace.NONE)
> new Element("foo", Namespace.ANY)
> new Element("foo", Namespace.INHERIT) // or null
> new Element("foo", someOtherNS);
> 
> Following the way most Java APIs work, and the textual representation
> of XML, the 3rd would be the one exected from not passing any namespace ---
> ie: new Element("foo") should not add a namespace declaration. But, in fact
> it does, because JDOM does the first... So, by NOT passing a Namespace to
> the constructor, JDOM adds ns="" to the output...  That is the root of this
> entire conversation.  There needs to be a way to say
> DONT_ADD_ANYTHING_EXTRA.
> Defaults are fine, but if you are going to default to something that
> doesn't
> match the output, you need a way to override it.
> 
> Malachi

There's no way I'm going to sign off on an Element being in a special
pseudo-namespace that's determined depending on where it's later placed
within the document.  You should know at construction time the namespace
of "foo", and you should be able to tell the constructor.

-jh-



More information about the jdom-interest mailing list