How to clone a subtree in C/C++ using Microsoft XML DOM

admin

Administrator
Staff member
How to clone a subtree in C/C++ using Microsoft XML DOM. According to theMSDN library, I can do it very easily like this:pNewNode=pSubRootNode->cloneNode(TRUE);pSubRootNode->GetparentNode()->appendChild(pNewNode);cnt=pNewNode->childNodes->Getlength();However, after cloned, only the root of the subtree is duplicated and appended,none of its child nodes are duplicated, although the parameter is true, whichindicates the clone is recursive. When I check the size of NewNode's childnodes. It is 0. Seems that cloneNode doesn't do what it is supposed do.Can anyone tell me how to clone a subtree?Thanks a lot,Song
 
Back
Top