All you have to do is create a docfragment and append the document to that. Then add the docfragment to the root of the other document...
DOMDocument *one = ..... DOMDocument *two = ..... DOMDocumentFragment *frag = two->createDocumentFragment(); frag->appendChild(two->getDocumentElement()); DOMNode *root = one->getDocumentElement(); root->appendChild(frag); There are several problems with this. The documents have to have the same URI. And there might be other issues with this that you might run across. However, thats the general idea. On Wed, 2002-10-02 at 12:40, Rama Revanur wrote: > Hi, > > I am trying to append a DOMDocument to a root node in another document.When i do >that, i get WRONG_DOCUMENT_ERR: > I read that DOMDocumentFragment must be used in such situation, is that correct.If >so can anyone show me how to do that. > > Thanks, > > Rama > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
