source: icGREP/icgrep-devel/icgrep/combine/pugixml/docs/samples/modify_add.cpp @ 5516

Last change on this file since 5516 was 5516, checked in by faldebey, 21 months ago

added combinatorial testing tool

File size: 742 bytes
Line 
1#include "pugixml.hpp"
2
3#include <iostream>
4
5int main()
6{
7    pugi::xml_document doc;
8
9    // tag::code[]
10    // add node with some name
11    pugi::xml_node node = doc.append_child("node");
12
13    // add description node with text child
14    pugi::xml_node descr = node.append_child("description");
15    descr.append_child(pugi::node_pcdata).set_value("Simple node");
16
17    // add param node before the description
18    pugi::xml_node param = node.insert_child_before("param", descr);
19
20    // add attributes to param node
21    param.append_attribute("name") = "version";
22    param.append_attribute("value") = 1.1;
23    param.insert_attribute_after("type", param.attribute("name")) = "float";
24    // end::code[]
25
26    doc.print(std::cout);
27}
28
29// vim:et
Note: See TracBrowser for help on using the repository browser.