As I feared, then. It's not safe to keep a pointer
to a node in a document when nodes are added to or deleted from
the document. Keeping an XPath is not safe, either. I tested by adding node->get_path() in the dom_parser example program. Some of the returned XPaths are "/example/examplechild[1]" and "/example/examplechild[2]". Which /example/examplechild is the second one may of course change if new nodes are added. There is in fact a way to copy nodes, although it might become more involved than you want, if it's not an element node. You can create a xmlpp::Document and add nodes to it. You can copy an element node with or without all its children from another document with xmlpp::Document::create_root_node_by_import(). xmlpp::Node::import_node() can also be useful. Den 2015-09-22 kl. 13:02, skrev Park,
Joseph:
|