How to append an exsiting pugi::xml_node
into another one using pugixml ?
the only function that i know is :
pugi::xml_node node = root.append_child("child");
You should use cloning functions described here:
http://pugixml.org/docs/manual.html#modify.clone
Note that cloning functions can't clone the entire document - i.e. if you have a document that's loaded from this data:
<node><child /></node>
Then if you want to clone this data into <child> node, you should do:
doc.child("node").child("child").append_copy(doc.child("node"));
This will yield the following document:
<node><child><node><child /></node></child></node>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With