Provides an interface for the management of structured data.
The XML module provides comprehensive support for XML 1.0 document parsing, manipulation, and querying. It integrates with the XPath module to deliver a standards-compliant XML processing environment with extensive querying capabilities.
The module implements full XML 1.0 parsing and serialisation, including support for namespaces, attributes, CDATA sections, processing instructions, and DOCTYPE declarations. Documents can be loaded from files, strings, or streams, and modified programmatically through a tree-based API. The parser validates well-formedness and provides detailed error reporting for malformed documents.
All aspects of XPath 2.0 are supported except for the following:
namespace::* and namespace::prefix axis expressions are not supported.declare variable $name external) are not supported.http://www.w3.org/2005/xpath-functions/collation/codepoint) is supported. Custom collation URIs are rejected.The module implements core XQuery 1.0 functionality, including FLWOR expressions (for, let, where, order by, return, group by, count clauses), node constructors (element, attribute, document, text, comment, processing instruction), and a comprehensive function library covering strings, numbers, sequences, dates, durations, QNames, and document access. XQuery support excludes the following:
XValueNodes | XValueToNumber | XValueToString
XMLAttrib | XPathValue | XTag
For node-set XPathValue objects, returns the node-set as an array.
| Parameter | Description |
|---|---|
| Value | The XPathValue to convert. |
| Result | The node-set is returned here as an array of XTag structures. |
If an XPathValue represents a node-set (type XPVT::NODE_SET) then XValueToNodes() will return a direct pointer to the node-set array.
Note: The integrity of the array is not guaranteed if the original XML document is modified or freed.
| Okay | Operation successful. |
|---|---|
| NoData | No data is available for use |
| Mismatch | A mis-match has been detected that prevents further processing |
| NullArgs | Function call missing argument value(s) |
Converts an XPathValue to a 64-bit floating point value.
| Parameter | Description |
|---|---|
| Value | The XPathValue to convert. |
| Result | The numeric representation of the value is returned here. |
Call XValueToNumber() to convert an XPathValue object to a 64-bit floating point number. This function also includes cover support for boolean types, converting true to 1.0 and false to 0.
| Okay | Operation successful. |
|---|---|
| NoData | No data is available for use |
| NullArgs | Function call missing argument value(s) |
Converts an XPathValue to its string representation.
| Parameter | Description |
|---|---|
| Value | The XPathValue to convert. |
| Result | Receives the string representation of the value. |
Call XValueToString() to convert an XPathValue object into its string representation.
| Okay | Operation successful. |
|---|---|
| NoData | No data is available for use |
| NullArgs | Function call missing argument value(s) |
Type descriptors for XPathValue
| Name | Description |
|---|---|
| XPVT::Array | |
| XPVT::Boolean | |
| XPVT::Date | |
| XPVT::DateTime | |
| XPVT::Map | |
| XPVT::NodeSet | |
| XPVT::Number | |
| XPVT::String | |
| XPVT::Time |
Standard flags for XTag.
| Name | Description |
|---|---|
| XTF::CDATA | Tag represents CDATA. |
| XTF::COMMENT | Tag represents a comment of the format <!-- Comment -->. |
| XTF::INSTRUCTION | Tag represents an instruction of the format <?xml?>. |
| XTF::NOTATION | Tag represents a notation of the format <!XML>. |
| Field | Type | Description |
|---|---|---|
| Name | STRING | Name of the attribute |
| Value | STRING | Value of the attribute |
| Field | Type | Description |
|---|---|---|
| Type | XPVT | Identifies the type of value stored |
| NumberValue | DOUBLE | Defined if the type is Number or Boolean |
| StringValue | STRING | Defined if the type is String |
| Field | Type | Description |
|---|---|---|
| ID | INT | Globally unique ID assigned to the tag on creation. |
| ParentID | INT | UID of the parent tag |
| LineNo | INT | Line number on which this tag was encountered |
| Flags | XTF | Optional flags |
| NamespaceID | UINT | Hash of namespace URI or 0 for no namespace |
| Reserved | INT | Private |
| Attribs | kt::vector<XMLAttrib> | Array of attributes for this tag |
| Children | kt::vector<XTag> | Array of child tags |