You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by tom john <cy...@yahoo.com> on 2001/12/19 14:52:39 UTC

Adding node to new xml document

Hi,

I have problem adding a node from a document to a new
one. i can compile but gives runtime error.

here is how i try to do:

DocumentImpl newdoc = new DocumentImpl();

 

//get xmldoc of an xml file
Document xmldoc = file2Document("note.xml");


if(xmldoc != null)
{
  // get root node of the read xml file

Element notifyNode =
(Element)xmldoc.getDocumentElement();

  Element root = newdoc.createElement("new");

  root.appendChild(notifyNode);

  newdoc.appendChild(root);

}



 

this works fine but gives runtime error.
hope someone can help
 

regards


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org