From a8091a9031f26dcdab1e14a55fd46d0603c225de Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Wed, 1 Jun 2011 11:19:42 +0300 Subject: When reparenting, remove child from old parent --- example.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'example.cpp') diff --git a/example.cpp b/example.cpp index 166ae98..8346749 100644 --- a/example.cpp +++ b/example.cpp @@ -43,6 +43,11 @@ int main() node->add_element("subsubnode")->add_comment( "i am in pretty deep waters here, man .."); + node = root->add_element("node")->set_attr("id", 6); + node = node->add_element("subnode")->set_attr("id", 66); + + root->add_child(node); + std::cout << root->to_string(true) << std::endl; return 0; -- cgit v1.2.3