![]() |
zeep::xml::doc_type
// In header: <zeep/xml/document.hpp> struct doc_type { // public data members std::string m_root; std::string m_pubid; std::string m_dtd; // pubid is empty for SYSTEM DOCTYPE };
zeep::xml::document is the class that contains a parsed XML file. You can create an empty document and add nodes to it, or you can create it by specifying a string containing XML or an std::istream to parse.
If you use an std::fstream to read a file, be sure to open the file ios::binary. Otherwise, the detection of text encoding might go wrong or the content can become corrupted.
Default is to parse CDATA sections into zeep::xml::text nodes. If you want to preserve CDATA sections in the DOM tree, you have to call set_preserve_cdata before reading the file.
By default a document is not validated. But you can turn on validation by using the appropriate constructor or read method, or by setting set_validating explicitly. The DTD's will be loaded from the base dir specified, but you can change this by assigning a external_entity_ref_handler.
A document has one zeep::xml::root_node element. This root element can have only one zeep::xml::element child node.