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

philip.nelson at omniresources.com philip.nelson at omniresources.com
Wed Aug 29 08:36:40 PDT 2001

> I tried this with the beta 7 binaries, and also downloaded the source
> yesterday (8-28-01) afternoon and have the same problem.
> When I give my root element (using XMLOutputter) a namespace of just
> "xmlns=http://www.someplace.com" I do not explicitly assign a 
> namespace to
> any of the children elements at any level, but the first 
> level children of
> the root are assigned a namespace of 'xmlns=""' which I can 
> not figure out
> why and can not get ride of it.  This should not be happening 
> and makes it
> invalid against the schema.  

You *must* assign the namespace to each element you create.  A child element
does not automagically get the parents namespace which means it is in the ""
namespace.  This is by design and was *HEAVILY* discussed here.

More information about the jdom-interest mailing list