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

Phill_Perryman at Mitel.COM Phill_Perryman at Mitel.COM
Thu May 5 04:51:21 PDT 2005


does not 

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

work

/Phill
IS Dept, Software Engineer.
phill_perryman at mitel.com
http://www.mitel.com
Tel: +44 1291 436023




Dr NoName <spamacct11 at yahoo.com>
Sent by: jdom-interest-bounces at jdom.org
05/05/2005 00:04

 
        To:     jdom-interest at jdom.org
        cc: 
        Subject:        [jdom-interest] creating & adding a node at the same time


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
want:

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

AND/OR:

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

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

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

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

thanks,

Eugene


 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20050505/be3d9db3/attachment.htm


More information about the jdom-interest mailing list