[jdom-interest] creating & adding a node at the same time

Dr NoName spamacct11 at yahoo.com
Wed May 4 16:04:29 PDT 2005

Hi all,

jdom looks pretty cool. I use it for building xml
documents. However, I often find that I need to create
an element and add it to the higherarchy, but jdom
doesn't provide a one-step way to do it. Essentially I

child = new Element("foo", parent);


child = parent.addContent( new Element("foo") );

but neither of the above works, so I constantly have
to do:

child = new Element("foo");

This is actually rather annoying. A single-step
solution would be much better. Any chance the api
could be modified to include this?



Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 

More information about the jdom-interest mailing list