[jdom-interest] XmlOutputter - printNamespace - NO_NAMESPACE outputs xmlns="", bug?

Eric VERGNAUD eric.vergnaud at wanadoo.fr
Thu Jul 3 07:53:19 PDT 2003


le 3/07/03 13:59, Elliotte Rusty Harold à elharo at metalab.unc.edu a écrit :

> At 7:09 AM +0200 7/3/03, Eric VERGNAUD wrote:
> 
> 
>> I still think there is a counter-intuitive behaviour with namespaces when
>> creating a document. When you write:
> 
> JDOM always puts each element in exactly the namespace you specify.
> If you don't specify a namespace, the element doesn't get a
> namespace. I think that's quite intuitive.

Yes it does, it gets the null namespace, and loses the 'current' namespace.
Let's not be religious about this. I think this could be improved by
creating (in JDOM) a default PARENT namespace, so that when creating a new
Element with no namespace, it would get -if any- the namespace on top of the
namespace stack, instead of NONAMESPACE. Since this has backward
compatibility issues, it would require to set a pref somewhere in the JDOM
initialization process.

Don't you think it's an idea ?

Eric




More information about the jdom-interest mailing list