This class' parser is focused on size and speed, and parses a subset of XML: there is no validation, no entity resolution (other than the built-in entities such as < and &), and no comment parsing. No CDATA elements are allowed. The only encoding supported is UTF-8.
Mixed content is not recommended -- elements can have either sub-elements or text. With this constraint, there is no need for white-space ignoring heuristics. Also, there is no need to keep track of an element's children as Nodes -- they are always Elements.
The main classes are:
Public Types | |
typedef std::map< std::string, std::string > | AttributeMap |
typedef Element::children_t | ElementList |
list of elements such as that filled in by Element::getChildren | |
Static Public Member Functions | |
static std::string | replaceEntities (const std::string &input) |
returns "a<b" for "a<b" | |
static std::string | replaceWithEntities (const std::string &input) |
returns "a<b" for "a<b" | |
Classes | |
class | Document |
An XML Document. More... | |
class | Element |
An XML Element. More... | |
class | Outputter |
Allows you to write a XML Document to an XML output stream. More... | |
class | Parser |
Allows you to build a XML Document from an XML input stream. More... |
typedef std::map< std::string, std::string > code::XML::AttributeMap |
list of elements such as that filled in by Element::getChildren
static std::string code::XML::replaceEntities | ( | const std::string & | input | ) | [static] |
returns "a<b" for "a<b"
static std::string code::XML::replaceWithEntities | ( | const std::string & | input | ) | [static] |
returns "a<b" for "a<b"