Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] Element Navigation/Modification

george exarchakos

2004-07-08


Please guys...
I am very new to JDOM and I am stuck in something
possibly very easy for you.

I am trying to start from the root element, pick one
of its children and modify/create it, pick one of the
last child's children and modify/create it etc but it
seems that I do not succeed.

Document doc = new Document();
Element root = doc.getRootElement();
Element el = root;
Element tmpEl;
for(int i=0; i<5; i++)
{
 if(el==null)
 {
    tmpEl = new Element(i);
    el.addContent(tmpEl);
    el = tmpEl;
 }
 else el = el.getChild(i);
}

Where is my mistake?
Please SOS HELP!

Thank you very much in advance;

--George

____________________________________________________________
Do You Yahoo!?
οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½?οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ @yahoo.gr οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½?οΏ½οΏ½?οΏ½οΏ½?http://www.otenet.gr
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.