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

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

added combinatorial testing tool

File size: 766 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    // print document to standard output (prints <?xml version="1.0"?><foo bar="baz"><call>hey</call></foo>)
13    doc.save(std::cout, "", pugi::format_raw);
14    std::cout << std::endl;
15
16    // print document to standard output as a regular node (prints <foo bar="baz"><call>hey</call></foo>)
17    doc.print(std::cout, "", pugi::format_raw);
18    std::cout << std::endl;
19
20    // print a subtree to standard output (prints <call>hey</call>)
21    doc.child("foo").child("call").print(std::cout, "", pugi::format_raw);
22    std::cout << std::endl;
23    // end::code[]
24}
25
26// vim:et
Note: See TracBrowser for help on using the repository browser.