[jdom-interest] Element Navigation/Modification

george exarchakos gexarch at yahoo.gr
Thu Jul 8 13:04:08 PDT 2004


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



More information about the jdom-interest mailing list