Dear Alberto,

Thanks a lot! Your are a sooooo kind guy and my HERO! :-) How can i missed
that?

Of course you were right. After refactoring my code (1 minute work) and use
importNode() first before appending the node all works like charm and i get
my merged complete XML-OutputDocument.

Thank you also for the hint with the try/catch thingy. I know i should use
it. But somehow i find my code very cluttered with all that try/catch lines
:-( And mostly all went well without it. No good style, i know...but humans
are lazy :-))) But take my pledge, that i now will use it more often in the
future.

Wish you happy Holidays and thx. Again very much!
Joerg

-----Ursprüngliche Nachricht-----
Von: Alberto Massari [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 20. Dezember 2006 13:31
An: [email protected]
Betreff: Re: Problem with transfering a node from one document to another

Hi Joerg,
the exception you are getting is probably WRONG_DOCUMENT_ERR (hint: 
add a try/catch(DOMException&) to your code); from the doc
(http://xml.apache.org/xerces-c/apiDocs/classDOMNode.html#z229_15)
you can see that it is "raised if newChild was created from a different
document than the one that created this node". In this case you first need
to "import" such node into the new DOMDocument using DOMDocument::importNode
(http://xml.apache.org/xerces-c/apiDocs/classDOMDocument.html#z59_0),
then use appendChild on the newly created clone of the original node

Alberto



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to