Simple C Expat Wrapper (SCEW)
1.1.7
|
Accessors for XML root elements and preambles. More...
Files | |
file | tree.h |
SCEW tree handling routines. | |
Functions | |
SCEW_API scew_element * | scew_tree_root (scew_tree const *tree) |
Returns the root element of the given tree. More... | |
SCEW_API scew_element * | scew_tree_set_root (scew_tree *tree, XML_Char const *name) |
Creates the root element of an XML tree with the given name. More... | |
SCEW_API scew_element * | scew_tree_set_root_element (scew_tree *tree, scew_element *root) |
Sets the root element of an XML tree with the given element. More... | |
SCEW_API XML_Char const * | scew_tree_xml_preamble (scew_tree const *tree) |
Return the XML preamble for the given tree. More... | |
SCEW_API void | scew_tree_set_xml_preamble (scew_tree *tree, XML_Char const *preamble) |
Sets the preamble string for the XML document. More... | |
Accessors for XML root elements and preambles.
SCEW_API scew_element* scew_tree_root | ( | scew_tree const * | tree | ) |
Returns the root element of the given tree.
SCEW_API scew_element* scew_tree_set_root | ( | scew_tree * | tree, |
XML_Char const * | name | ||
) |
Creates the root element of an XML tree with the given name.
Note that if the tree already had a root element, it will be overwritten, possibly causing a memory leak, as the old root element is not automatically freed. So, if you plan to set a new root element, remember to free the old one first.
tree | the XML tree to set a new root element to. |
name | the name of the new XML root element. |
SCEW_API scew_element* scew_tree_set_root_element | ( | scew_tree * | tree, |
scew_element * | root | ||
) |
Sets the root element of an XML tree with the given element.
Note that if the tree already had a root element, it will be overwritten, possibly causing a memory leak, as the old root element is not automatically freed. So, if you plan to set a new root element, remember to free the old one first.
tree | the XML tree to set a new root element to. |
root | the new XML root element. |
SCEW_API XML_Char const* scew_tree_xml_preamble | ( | scew_tree const * | tree | ) |
Return the XML preamble for the given tree.
The XML preamble is the text between the XML declaration and the first element. It typically contains DOCTYPE declarations or processing instructions.
SCEW does not provide specific functions for DOCTYPEs or processing instructions, but they are treated as a whole.
tree | the XML tree to obtain the preamble for. |
SCEW_API void scew_tree_set_xml_preamble | ( | scew_tree * | tree, |
XML_Char const * | preamble | ||
) |
Sets the preamble string for the XML document.
Typically this contains DOCTYPE declarations or processing instructions. The old XML tree preamble will be freed, if any.
SCEW does not provide specific functions for DOCTYPEs or processing instructions, but they can be added as a whole.
tree | the XML tree to set the preamble to. |
preamble | the XML preamble text for the given tree. |