I have found some fantastic examples of how to use boost property trees to read xml files. However, the real head scratcher for me is extracting the DOCTYPE value. Given an xml file with the line:
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
If I do something like this:
// Create an empty property tree object
boost::property_tree::ptree pt;
// Load the XML file into the property tree.
boost::property_tree::read_xml(filenameIn, pt);
// and then immediately write it back out again...
boost::property_tree::write_xml(filenameOut, pt);
I would expect content(filenameOut) == content(filenameIn).
But this isn't the case. Specifically the DOCTYPE node is missing. Therefore how can I extract the value of the DOCTYPE node?