Howto clone entire DOM Node

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Herewith:<br/>
<br/>
MSXML2::IXMLDOMElementPtr ElementRoot = pXMLDoc->GetdocumentElement();<br/>
MSXML2::IXMLDOMNodePtr NodeFirstChild = ElementRoot ->firstChild;<br/>
<br/>
MSXML2::IXMLDOMNodePtr ClonedChild = NodeFirstChild->cloneNode(true);<br/>
ElementRoot->appendChild( ClonedChild );<br/>
<br/>
I tried to clone the first child in the root element of an XML document. <br/>
<br/>
Even I pass true to the methode cloneNode, not the entire child is cloned.<br/>
Only the child it self is cloned and added to the root element. Its sub nodes<br/>
are not cloned and added. <br/>
<br/>
<br/>
How can I fix that?<br/>

View the full article
 
Back
Top