[jdom-interest] Default Namespace vs No-Namespace.

Elliotte Rusty Harold elharo at metalab.unc.edu
Fri Jul 4 04:57:05 PDT 2003


>I mean, forgetting how jdom works for a moment, if I
>have a document with no namespacing and then I want to
>make all elements adher to a namespace then all that I
>have to do is add xmlns="mynamespace" to the root
>element using a text editor and all children will then
>inherit this namespace. 
>
>In order to do this in jdom, I'd have to iterate
>though the entire set of nodes and set each node to
>the given namespace.  
>
>I do understand your points and I don't have a good
>solution on how to solve this, I suppose it is just
>frustrating that what I can do with a text editor with
>a single node change I can not do with jdom without
>modifying the source.

You are confusing syntax with structure. A text editor operates on 
syntax. JDOM operates on structure. Using both at the same time is 
asking for trouble. See 
http://www.cafeconleche.org/books/effectivexml/chapters/15.html
-- 

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)
   http://www.cafeconleche.org/books/xmljava
   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA



More information about the jdom-interest mailing list