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

Rolf Lear rlear at algorithmics.com
Thu Jul 3 08:01:37 PDT 2003


Here is a suggestion... Solve lots of problems.

Remove public Element(String tag) constructor..... (also throw an exception
if Namespace in Element(String,Namespace) constructor is null instead of
reverting it to Namespace.NO_NAMESPACE).


;-)

Solve so many problems. Force people to be aware of how namespaces work, and
to choose the namespace at construction time.

In the ways of intuitiveness, this is THE MOST intuitive mechanism, nothing
is "hidden" from the programmer.

When people say "where has it gone?" we just say, "Well, every element in
XML has a namespace, you have to tell us which one to use! ;-)"

Rolf

-----Original Message-----
From: Eric VERGNAUD [mailto:eric.vergnaud at wanadoo.fr]
Sent: Thursday, July 03, 2003 10:53 AM
To: Elliotte Rusty Harold; Bradley S. Huffman; 'jdom-interest at jdom.org'
Subject: Re: [jdom-interest] XmlOutputter - printNamespace -
NO_NAMESPACE outputs xmlns="", bug?


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

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20030703/7c61d370/attachment.htm


More information about the jdom-interest mailing list