Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deep copy of "xml_document" in pugixml "Clone"

Tags:

pugixml

I'm using pugixml library to read and write xml files.

How can I do deep copy "Clone" to the xml_document object in pugixml library?

like image 561
user2179256 Avatar asked Mar 05 '14 15:03

user2179256


1 Answers

Here's the easiest option:

xml_document copy;
copy.reset(doc);

If you need to be more fine-grained you can use copy.append_copy() on individual nodes.

like image 186
zeuxcg Avatar answered Jan 01 '23 11:01

zeuxcg