You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am not entirely sure the best way to move an Element up one, or down one.
It would be very convenient to have a specific function to copy the entire contents of an Element (all attributes, and text) and then to move it to any place within the current Document.
I looked at #135, but this seems to be addressing moving to a new document.
This would be useful for copying items, i.e.
myXMLElement=myBaseXMLElement->FirstChildElement("Class1")->FirstChildElement("copyItem");
myOtherXMLElement->CopyElement(myXMLElement, afterMyDestinationElement);
or
myOtherXMLElement->MoveElement(myXMLElement, afterMyDestinationElement); //this deletes tmyXMLElement after copying it.
Is there an existing way to do this? I have tried a few methods, but I have not found something that I can use correctly.
The text was updated successfully, but these errors were encountered:
Copying can be done with ShallowClone(), but that doesn't copy sub-nodes, and certainly doesn't have the rich functionality you are proposing. I think having a DeepClone() would solve many of these sort of use cases (moving elements between trees), and DeepClone() combined with the existing would at least give the functionality you want.
Hi,
I am not entirely sure the best way to move an Element up one, or down one.
It would be very convenient to have a specific function to copy the entire contents of an Element (all attributes, and text) and then to move it to any place within the current Document.
I looked at #135, but this seems to be addressing moving to a new document.
This would be useful for copying items, i.e.
myXMLElement=myBaseXMLElement->FirstChildElement("Class1")->FirstChildElement("copyItem");
myOtherXMLElement->CopyElement(myXMLElement, afterMyDestinationElement);
or
myOtherXMLElement->MoveElement(myXMLElement, afterMyDestinationElement); //this deletes tmyXMLElement after copying it.
Is there an existing way to do this? I have tried a few methods, but I have not found something that I can use correctly.
The text was updated successfully, but these errors were encountered: