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/11/08 12:14:34 UTC

creating new document from a node

Hi,
I need to create a new xml document of a node got from
a big xml document. 
I use:

node - node from another document

Document xmldoc = new DocumentImpl();

xmldoc.appendChild(node);

this code compiles but gives runtime error.
 will be greateful if anyone can help


__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.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


Re: creating new document from a node

Posted by Scott Moore <sc...@netdecide.com>.
You need to import your node into the new document.

xmldoc.importNode(node);

There might be another parameter you need to pass.  It's in the Javadocs.

Scott

----- Original Message ----- 
From: "tom john" <cy...@yahoo.com>
To: <xe...@xml.apache.org>
Sent: Thursday, November 08, 2001 6:14 AM
Subject: creating new document from a node


> Hi,
> I need to create a new xml document of a node got from
> a big xml document. 
> I use:
> 
> node - node from another document
> 
> Document xmldoc = new DocumentImpl();
> 
> xmldoc.appendChild(node);
> 
> this code compiles but gives runtime error.
>  will be greateful if anyone can help
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.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
> 


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