<br><font size=2 face="sans-serif">does not </font>
<br>
<br><font size=2 face="sans-serif">parent.addContent(child = new Element("child"));</font>
<br>
<br><font size=2 face="sans-serif">work<br>
<br>
/Phill<br>
IS Dept, Software Engineer.<br>
phill_perryman@mitel.com<br>
http://www.mitel.com<br>
Tel: +44 1291 436023</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Dr NoName <spamacct11@yahoo.com></b></font>
<br><font size=1 face="sans-serif">Sent by: jdom-interest-bounces@jdom.org</font>
<p><font size=1 face="sans-serif">05/05/2005 00:04</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: jdom-interest@jdom.org</font>
<br><font size=1 face="sans-serif"> cc: </font>
<br><font size=1 face="sans-serif"> Subject: [jdom-interest] creating & adding a node at the same time</font></table>
<br>
<br>
<br><font size=2 face="Courier New">Hi all,<br>
<br>
jdom looks pretty cool. I use it for building xml<br>
documents. However, I often find that I need to create<br>
an element and add it to the higherarchy, but jdom<br>
doesn't provide a one-step way to do it. Essentially I<br>
want:<br>
<br>
child = new Element("foo", parent);<br>
<br>
AND/OR:<br>
<br>
child = parent.addContent( new Element("foo") );<br>
<br>
but neither of the above works, so I constantly have<br>
to do:<br>
<br>
child = new Element("foo");<br>
parent.addContent(child);<br>
<br>
This is actually rather annoying. A single-step<br>
solution would be much better. Any chance the api<br>
could be modified to include this?<br>
<br>
thanks,<br>
<br>
Eugene<br>
<br>
<br>
<br>
Discover Yahoo! <br>
Have fun online with music videos, cool games, IM and more. Check it out! <br>
http://discover.yahoo.com/online.html<br>
_______________________________________________<br>
To control your jdom-interest membership:<br>
http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com<br>
</font>
<br>
<br>