Suppose you have 2 documents.
docONE
docTWO

If I create a DOMElement with docOne

DOMElement *myChild = docOne->createElement(XMLString::transcode("temp"));

and I then try to attatch the new myChild element to docTWO, like this

docTWO->getDocumentElement()->appendChild(myChild);

I get an exception raised.

Why is this? I see it is possible to get the owner document of a node.
But I can't see the matching set method.

Also, is there no way to create an element without attaching it to a
document?
sort of

DOMElement *myChild = new DOMElement(XMLString::transcode("temp"));

Thanks

Reply via email to