[jdom-interest] xmlns="" in children elements of root

Rodney S. Foley rsfoley at harddollar.com
Wed Aug 29 10:33:53 PDT 2001

I would purpose that JDOM check every time an element(a) is added to another
element(a) that element(a) checks for element(b)'s namespace.  If none was
set, then element(a) give's element(b) it's namespace, and set's a flag on
element(b) stating namespace was automatically set.  

So anytime an element is moved around on the tree that if the namespace was
automatically set, that it continues to be changed to it's new parent's

-----Original Message-----
From: philip.nelson at omniresources.com
[mailto:philip.nelson at omniresources.com]
Sent: Wednesday, August 29, 2001 9:55 AM
To: laurent.bihanic at atosorigin.com
Cc: jdom-interest at jdom.org
Subject: RE: [jdom-interest] xmlns="" in children elements of root

> Yet, I agree with Rodney that if you define a default 
> Namespace one can expect 
> the constructor with no Namespace argument to use the default 
> Namespace.
> This is not an issue of whether JDOM is right or wrong but 
> rather of how 
> intuitive the JDOM API is and should be.
> Laurent

Since I argued your point in those earler discussions, I can only agree with
you that the api as it stands does not follow what intuition would dictate.
However, I came to accept the api the way it is because,  first, it really
is pretty easy to use, and second, this approach puts the least amount of
processing burden on the api.  To look upward for namespace declarations,
which JDOM does not model anyway, would have be done on very single insert
and anytime the namespaces were changed.  This way really is simpler and
faster I think.

The JDOM approach to namespaces is really simple and can be described in a
simple story (thanks Jason for that phrase which I use a lot these days
;-)).  Each element has a namespace and you are responsible to assign it in
your code.
To control your jdom-interest membership:

More information about the jdom-interest mailing list