W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1999

Combining two trees

From: Daniel Noguerol <daniel.noguerol@sagemaker.com>
Date: Fri, 8 Oct 1999 11:52:11 -0400
To: <www-dom@w3.org>
Message-ID: <NDBBKELGCMIJLDDFNMGOAECLCAAA.daniel.noguerol@sagemaker.com>
Hello all.

If I have Document A (built from an XML source) with some child node "foo"
and Document B (built from a different XML source), is there a way for me to
replace the "foo" node in Document A with the entire Document B tree?

I tried to do this by creating a DocumentFragment from Document B and doing
a replaceNode() in Document A. I get an exception WRONG_DOCUMENT_ERR where
it tells me the node I'm inserting is from a different Document than the one
that created it.

Is there a way to do this?

Thanks in advance for any help.

Dan Noguerol
Received on Friday, 8 October 1999 11:51:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:46 GMT