Use:
newNode = docOne.importNode( docTwo.getFirstChild() )
Thanks,
-----Original Message-----
From: Judd, Chris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 16, 2000 12:24 PM
To: '[EMAIL PROTECTED]'
Subject: Copy DOM elements
Is there a reason to prevent the coping of elements from one DOM to another?
I would like to be able to deep copy a DOM element from one DOM to another
DOM. When I attempt to do :
((DocumentImpl)docOne).setErrorChecking(false);
((DocumentImpl)docTwo).setErrorChecking(false);
Node newNode = docTwo.getFirstChild().cloneNode(true);
docOne.getFirstChild().appendChild(newNode);
I get a org.apache.xerces.dom.DOMExceptionImpl: WRONG_DOCUMENT_ERR. I
expected the setErrorChecking with a false parameter to prevent the
ownerDocument check.