[jdom-interest] output with namespace only on root element

Elliotte Rusty Harold elharo at metalab.unc.edu
Mon Jun 9 07:41:51 PDT 2003

>When I use XMLOutputter to output the document all elements have the 
>"cprt" namespace prefix but I only want the root element to show 
>Is this possible?
>I guess I could add all child elements without a namespace but then 
>the JDOM document would not be accurate.

You misunderstand namespaces. Unprefixed child elements are *not* in 
the same namespace as their parent element unless the default 
namespace is the same as the namespace of the parent element.

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)

More information about the jdom-interest mailing list