aboutsummaryrefslogtreecommitdiff
path: root/example.cpp
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2011-06-01 11:19:42 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2011-06-01 11:19:42 +0300
commita8091a9031f26dcdab1e14a55fd46d0603c225de (patch)
treecbab4ac7d1f91a8e586ca9c129eebfb0fab071fc /example.cpp
parent8eba476357c8488be510f012594f305848a7eeb6 (diff)
downloadsxml-a8091a9031f26dcdab1e14a55fd46d0603c225de.tar.gz
sxml-a8091a9031f26dcdab1e14a55fd46d0603c225de.zip
When reparenting, remove child from old parent
Diffstat (limited to 'example.cpp')
-rw-r--r--example.cpp5
1 files changed, 5 insertions, 0 deletions
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;