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

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

added combinatorial testing tool

File size: 661 bytes
Line 
1#include "pugixml.hpp"
2
3#include <iostream>
4
5int main()
6{
7    // tag::code[]
8    // get a test document
9    pugi::xml_document doc;
10    doc.load_string("<foo bar='baz'><call>hey</call></foo>");
11
12    // add a custom declaration node
13    pugi::xml_node decl = doc.prepend_child(pugi::node_declaration);
14    decl.append_attribute("version") = "1.0";
15    decl.append_attribute("encoding") = "UTF-8";
16    decl.append_attribute("standalone") = "no";
17
18    // <?xml version="1.0" encoding="UTF-8" standalone="no"?>
19    // <foo bar="baz">
20    //         <call>hey</call>
21    // </foo>
22    doc.save(std::cout);
23    std::cout << std::endl;
24    // end::code[]
25}
26
27// vim:et
Note: See TracBrowser for help on using the repository browser.