Hi there, Got some error while appending a child node. Here is what I did. * There exist a .xml file with few elements. * Using Dom, I loaded the document into the memory. * Travelled to a particular node and tried appending a newly created node. * This doesn't work; giving the error WRONG_DOCUMENT_ERR The skeleton is :
The last statement throws DOMException. After reading manual, api and books, I could get only the meaning of the error code : WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
Is there a way to tell the document to accept any node that is created at runtime? Any help is appreciated. Thanks, Balaji [ January 22, 2003: Message edited by: Jeya Balaji ] [ January 25, 2003: Message edited by: Jeya Balaji ]
Joined: Jan 02, 2003
I had solved that problem with the following code :
that is, I used document instead of docImpl and document.getDocumentElement().appendChild instead of document.appendChild Regards, Balaji
subject: [Solved] WRONG_DOCUMENT_ERR while appending child