I would like to set the DOCTYPE of the generated XML document by boost::property_tree::write_xml
:
#include <string>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
int main()
{
using ptree = boost::property_tree::ptree;
ptree pt;
pt.put("ExampleKey", "ExampleValue");
std::ofstream file("test.xml");
boost::property_tree::write_xml(file, pt);
}
I tried with xml_writer_settings
but there is very little (to be kind) useful documentation about it. So I am not even aware if it can help or if it purpose is totally different.
How to set the DOCTYPE in the generated XML by boost::property_tree::write_xml
?