Код: Выделить всё
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
using namespace std;
namespace pt = boost::property_tree;
int main ()
{
boost::property_tree::ptree test;
test.put("1", "a");
test.put("1.1", "b");
pt::write_xml ("dst.xml", test);
return 0;
}
Shell
$ cat dst.xml
<?xml version="1.0" encoding="utf-8"?>
<1>a<1>b</1></1>
Код: Выделить всё
<?xml version="1.0" encoding="UTF-8" ?>
<a>
<b>
</b>
</a>
Код: Выделить всё
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
using namespace std;
namespace pt = boost::property_tree;
int main ()
{
boost::property_tree::ptree test;
test.put("a");
test.put("a.b");
pt::write_xml ("dst.xml", test);
return 0;
}