XML to forest round trip utility |
Typedefs | |
typedef forest< dictionary_t > | element_forest_t |
Functions | |
template<typename R > | |
void | element_forest_to_xml (const R &f, std::ostream &output, bool verbose=true) |
element_forest_t | xml_parse_to_forest (const char *xml) |
Detailed Description
For every node in the forest, the following keys may be present. The description of the keys will also describe additional keys that may be present in the dictionary:
- name_t('> type') (use name_type from the header) : Either of the strings "element" or "chardata", denoting the type of information found in this particular node.
- name_t('> chardata') (use name_chardata from the header) : A node in the forest whose sole content is character data found between element tags.
- name_t('> element_name') (use name_element_name from the header) : A node in the forest that contains the name of an element. Additional keys are allowed in the dictionary, and will be output as attributes of the element in the XML serialization.
Typedef Documentation
typedef forest<dictionary_t> element_forest_t |
Definition at line 56 of file xml_element_forest.hpp.
Function Documentation
void adobe::element_forest_to_xml | ( | const R & | f, |
std::ostream & | output, | ||
bool | verbose = true |
||
) |
Converts a forest of dictionaries to an XML file.
- Parameters:
-
f A depth adaptor range of a forest of dictionaries; the source of the eventual XML file. output The output stream to which the XML serialization will be written. verbose If true, will print a more-formatted, easier-to-read version of XML; if false, will not introduce spacing or newlines to the XML output.
Definition at line 236 of file xml_element_forest.hpp.
element_forest_t adobe::xml_parse_to_forest | ( | const char * | xml ) |
Parses an XML string into a forest of dictionaries.
- Parameters:
-
xml the string to parse into the node forest.
- Returns:
- an element forest. See the documentation on the node format above for details on what will be within each node's dictionary.
Definition at line 322 of file xml_element_forest.hpp.