tags:

views:

16

answers:

1

How do I get a complete copy of a RapidXML xml_document?

There is a clone_node function; how to use to to create a complete copy of an existing document?

A: 

I'm sure there's a cleaner, tree-based approach, but I solved it with the following, where str is the xml output from another doc:

xml_document<> doc;
doc.parse<0>(doc.allocate_string(str));
FreshCode