Re: Help please! Problem with insertBefore

>My XML file has a root element called "fanml" and a container element for
each new entry called "news".

In other words,
     <fanml>
          <news/>
          <news/>
     </fanml>

>insert my new news elements before my old ones?

     Element fanml=myDocument.getDocumentElement();
     //...
     Element firstNews=fanml.getFirstChild();
     fanml.insertBefore(myNewNews,firstNews);

Or

     //...
     firstNews=myDocument.getElementsByTagName("news").item(0);
     firstNews.getParent().insertBefore(myNewNews,firstNews);

Or anything equivalent...



______________________________________
Joe Kesselman  / IBM Research

Received on Thursday, 21 June 2001 10:43:34 UTC