Simple C Expat Wrapper (SCEW)
1.1.7
|
Handle XML trees properties. More...
Files | |
file | tree.h |
SCEW tree handling routines. | |
Enumerations | |
enum | scew_tree_standalone { scew_tree_standalone_unknown, scew_tree_standalone_no, scew_tree_standalone_yes } |
List of possible values for the standalone attribute. More... | |
Functions | |
SCEW_API XML_Char const * | scew_tree_xml_version (scew_tree const *tree) |
Returns the current XML version for the given tree. More... | |
SCEW_API void | scew_tree_set_xml_version (scew_tree *tree, XML_Char const *version) |
Sets the XML version in the XML declaration to the given tree. More... | |
SCEW_API XML_Char const * | scew_tree_xml_encoding (scew_tree const *tree) |
Returns the current XML character encoding for the given tree. More... | |
SCEW_API void | scew_tree_set_xml_encoding (scew_tree *tree, XML_Char const *encoding) |
Sets the character encoding used in the given XML tree. More... | |
SCEW_API scew_tree_standalone | scew_tree_xml_standalone (scew_tree const *tree) |
Returns whether the given tree is an standalone document. More... | |
SCEW_API void | scew_tree_set_xml_standalone (scew_tree *tree, scew_tree_standalone standalone) |
The standalone property tells the XML processor whether there are any other extra files to load, such as external entities or DTDs. More... | |
Handle XML trees properties.
enum scew_tree_standalone |
List of possible values for the standalone attribute.
The standalone attribute in an XML declaration defines whether the XML document is self consistent or not, that is, whether it needs to load any extra files.
Enumerator | |
---|---|
scew_tree_standalone_unknown |
Standalone attribute not defined. |
scew_tree_standalone_no |
Extra files are necessary. |
scew_tree_standalone_yes |
Document stands on its own. |
SCEW_API XML_Char const* scew_tree_xml_version | ( | scew_tree const * | tree | ) |
Returns the current XML version for the given tree.
This is the version specified in the "version" attribute in the XML declaration.
tree | the tree to return its version for. |
SCEW_API void scew_tree_set_xml_version | ( | scew_tree * | tree, |
XML_Char const * | version | ||
) |
Sets the XML version in the XML declaration to the given tree.
Currently there is one XML version, so the value is always 1.0. If there were more XML versions, this property tells to the XML processor which one to use.
tree | the XML tree to set the new XML version to. |
version | the new XML version for the given tree. |
SCEW_API XML_Char const* scew_tree_xml_encoding | ( | scew_tree const * | tree | ) |
Returns the current XML character encoding for the given tree.
The default, when creating new SCEW trees, is UTF-8.
Expat supports the following encodings:
As SCEW is based on Expat the same encodings are supported when parsing XML documents. However, SCEW only supports UTF-16 in Windows platforms.
Note that these encodings are only supported when parsing files, but not when creating new ones. So, it is the responsibility of the user to provide the correct characters.
tree | the XML tree to obtain its character encoding for. |
SCEW_API void scew_tree_set_xml_encoding | ( | scew_tree * | tree, |
XML_Char const * | encoding | ||
) |
Sets the character encoding used in the given XML tree.
Note that a user might want to use another encoding, different than the ones supported by Expat. And, as SCEW does not provide, or force, any encoding, the user is allowed to do so.
tree | the XML tree to set the new encoding to. |
encoding | the new character encoding for the given tree. |
SCEW_API scew_tree_standalone scew_tree_xml_standalone | ( | scew_tree const * | tree | ) |
Returns whether the given tree is an standalone document.
The standalone property tells the XML processor whether there are any other extra files to load, such as external entities or DTDs.
tree | the tree to check its standalone property for. |
SCEW_API void scew_tree_set_xml_standalone | ( | scew_tree * | tree, |
scew_tree_standalone | standalone | ||
) |
The standalone property tells the XML processor whether there are any other extra files to load, such as external entities or DTDs.
If the XML document can stand on its own, set it to scew_tree_standalone_yes.
tree | the XML tree to set the option to. |
standalone | the new XML tree standalone property. |