org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it

I use this implementation to add Node from one XML document to other.

Node firstDocImportedNode = firstDoc.importNode(secondDocsNode, true);
firstDocNode.appendChild(firstDocImportedNode );

See if this helps. Trick is just importing a Node to other Document, instead of directly appending.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)