HI, I tried it and it works, thanks. -----Original Message----- From: Jesse Pelton [mailto:[EMAIL PROTECTED]] Sent: 02/10/2002 02:16 To: '[EMAIL PROTECTED]' Subject: RE: WRONG_DOCUMENT_ERR when appending a DOMDocument to DOMNode
You'll probably need to call DOMDocument::importNode(). -----Original Message----- From: Justin Kirby [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 2:13 PM To: [EMAIL PROTECTED] Subject: Re: WRONG_DOCUMENT_ERR when appending a DOMDocument to DOMNode 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] --------------------------------------------------------------------- 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]
