|
Hi- I have 2 DOMDocuments, both of which were
created by the DOMBuilder. I have several nodes in one of these documents that
I would like to add to a specific place in the other one. However, everything
I try to do to accomplish this results in a DOMException: WRONG_DOCUMENT_ERR. Here is (roughly) my most recent attempt: DOMDocument *sourceDoc = parser->parse(…); DOMDocument *targetDoc = parser->parse(…); DOMNode *sourceLocation = sourceDoc-> getElementsByTagName(…)->item(0); DOMNode *targetLocation = targetDoc-> getElementsByTagName(…)->item(0); DOMNodeList *nodes = sourceLocation->getChildNodes(); for(int i=0; i<nodes->getLength(); i++) { DOMNode *node = nodes->item(i); sourceLocation->removeChild(node); targetLocation->appendChild(node); //
<-- throws WRONG_DOCUMENT_ERR } Any suggestions? Thanks, -Eric. |
- RE: Merging DOMDocuments. Eric J. Peters
- RE: Merging DOMDocuments. Jesse Pelton
