/** @mainpage Qore XML Module
@tableofcontents
@section xmlintro Introduction
XML functionality in the %Qore xml module is provided by the libxml2 library, which provides a powerful, stable, clean, and thread-safe basis for XML integration in %Qore. XML provides a way to describe hierarchical data, and thanks to libxml2, the xml module allows for easy serialization and deserialization between XML strings and %Qore data structures.
This module is released under a choice of two licenses:
- LGPL 2.1
- MIT (see COPYING.MIT in the source distribution for more information)
.
The module is tagged as such in the module's header (meaning it can be loaded unconditionally regardless of how the %Qore library was initialized).
To use the module in a %Qore script, use the \c %%requires directive as follows:
@code %requires xml @endcode
@note XML functionality was included in the main %Qore shared library until version 0.8.1, at which time the code was removed to make this module.
Classes provided by this module:
- @ref Qore::Xml::FileSaxIterator "FileSaxIterator": an iterator class for XML strings
- @ref Qore::Xml::SaxIterator "SaxIterator": an iterator class for XML strings
- @ref Qore::Xml::XmlDoc "XmlDoc": for analyzing and manipulating XML documents
- @ref Qore::Xml::XmlNode "XmlNode": gives information about XML data in an XML document
- @ref Qore::Xml::XmlReader "XmlReader": for parsing or iterating through the elements of an XML document
Also included with the binary xml module:
- WSDL user module
- SoapClient user module
- SoapHandler user module
- XmlRpcHandler user module
@section optionconstants Module Option Constants
The following constants give information about the availability of XML functionality (dependent on libxml2 features at compile time):
XML Option Constants
@htmlonly @endhtmlonly
Function Name |
Description |
makeFormattedXMLFragment() |
Serializes a hash into an XML string with formatting without an XML header. |
makeFormattedXMLString() |
Serializes a hash into an XML string with formatting and an XML header. |
makeXMLFragment() |
Serializes a hash into an XML string without an XML header or formatting. |
makeXMLString() |
Serializes a hash into a complete XML string with an XML header and without formatting. |
parseXMLAsData() |
parses an XML string as data (duplicate, out-of-order XML elements are collapsed into lists) and returns a %Qore hash structure. |
parseXMLAsDataWithRelaxNG() |
parses an XML string as data (duplicate, out-of-order XML elements are collapsed into lists) and validates against a RelaxNG schema string and returns a %Qore hash structure. |
parseXMLAsDataWithSchema() |
parses an XML string as data (duplicate, out-of-order XML elements are collapsed into lists) and validates against an XSD schema string and returns a %Qore hash structure. |
parseXML() |
parses an XML string (XML element order is preserved by appending numeric suffixes to %Qore hash key names when necessary) and returns a %Qore hash structure. |
parseXMLWithRelaxNG() |
parses an XML string (XML element order is preserved by appending numeric suffixes to %Qore hash key names when necessary) and validates against a RelaxNG schema string and returns a %Qore hash structure. |
parseXMLWithSchema() |
parses an XML string (XML element order is preserved by appending numeric suffixes to %Qore hash key names when necessary) and validates against an XSD schema string and returns a %Qore hash structure. |
@anchor xmlclasses
Class |
Description |
@ref Qore::Xml::FileSaxIterator "FileSaxIterator" |
An iterator class for file data |
@ref Qore::Xml::SaxIterator "SaxIterator" |
An iterator class for XML strings |
@ref Qore::Xml::XmlDoc "XmlDoc" |
For analyzing and manipulating XML documents |
@ref Qore::Xml::XmlNode "XmlNode" |
Gives information about XML data in an XML document |
@ref Qore::Xml::XmlReader "XmlReader" |
For parsing or iterating through the elements of an XML document |
@section XMLRPC XML-RPC
XML-RPC is a lightweight but powerful XML over HTTP web service protocol. The xml module includes builtin support for this protocol as described here. You can find more information about XML-RPC, including specifications and examples at http://xmlrpc.org.
Information about %Qore's XML-RPC serialization can be found below.
Function Name |
Description |
makeFormattedXMLRPCCallString() |
Serializes a hash into an XML string formatted for an XML-RPC call with formatting. |
makeFormattedXMLRPCCallStringArgs() |
Serializes a hash into an XML string formatted for an XML-RPC call with formatting, taking a single list argument for the argument list. |
makeFormattedXMLRPCCallStringWithEncoding() |
Serializes a hash into an XML string formatted for an XML-RPC call with formatting and an explicit output encoding |
makeFormattedXMLRPCCallStringArgsWithEncoding() |
Serializes a hash into an XML string formatted for an XML-RPC call with formatting, taking a single list argument for the argument list and an explicit output encoding |
makeFormattedXMLRPCFaultResponseString() |
Serializes a hash into an XML string formatted for an XML-RPC fault response with formatting. |
makeFormattedXMLRPCFaultResponseStringWithEncoding() |
Serializes a hash into an XML string formatted for an XML-RPC fault response with formatting and an explicit output encoding. |
makeFormattedXMLRPCResponseString() |
Serializes a hash into an XML string formatted for an XML-RPC response with formatting. |
makeFormattedXMLRPCResponseStringWithEncoding() |
Serializes a hash into an XML string formatted for an XML-RPC response with formatting and an explicit output encoding. |
makeFormattedXMLRPCValueString() |
Serializes a hash into an XML string in XML-RPC value format with formatting. |
makeXMLRPCCallString() |
Serializes a hash into an XML string formatted for an XML-RPC call without formatting. |
makeXMLRPCCallStringArgs() |
Serializes a hash into an XML string formatted for an XML-RPC call without formatting, taking a single list argument for the argument list. |
makeXMLRPCCallStringWithEncoding() |
Serializes a hash into an XML string formatted for an XML-RPC call without formatting and an explicit output encoding. |
makeXMLRPCCallStringArgsWithEncoding() |
Serializes a hash into an XML string formatted for an XML-RPC call without formatting, taking a single list argument for the argument list and an explicit output encoding. |
makeXMLRPCFaultResponseString() |
Serializes a hash into an XML string formatted for an XML-RPC fault response without formatting. |
makeXMLRPCFaultResponseStringWithEncoding() |
Serializes a hash into an XML string formatted for an XML-RPC fault response without formatting and an explicit output encoding. |
makeXMLRPCResponseString() |
Serializes a hash into an XML string formatted for an XML-RPC response without formatting. |
makeXMLRPCResponseStringWithEncoding() |
Serializes a hash into an XML string formatted for an XML-RPC response without formatting and an explicit output encoding. |
makeXMLRPCValueString() |
Serializes a hash into an XML string in XML-RPC value format without formatting. |
parseXMLRPCCall() |
deserializies an XML-RPC call string, returning a %Qore hash respresenting the call information. |
parseXMLRPCResponse() |
deserializies an XML-RPC response string, returning a %Qore hash respresenting the response information. |
parseXMLRPCValue() |
deserializies an XML-RPC value tree, returning a %Qore hash respresenting the information. |
@section constants XML Constants
All constants (and classes and namespaces) provided by this module are created under the Qore namespace (the main namespace for the %Qore Programming Language).
@section codetags Function and Method Tags
@subsection NOOP NOOP
Code with this flag makes no calculations, but rather returns a constant value. This flag is given to function and method variants that return a default value depending on the type of argument(s). When variants with this flag are resolved at parse time, a \c "call-with-type-errors" warning is raised (assuming this warning is enabled), unless \c PO_REQUIRE_TYPES or \c PO_STRICT_ARGS is set. If \c PO_REQUIRE_TYPES or \c PO_STRICT_ARGS is set, then these variants are inaccessible at parse time; resolving to a variant with this flag set at parse time causes an exception to be thrown.
These variants are included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
This tag is equal to @ref RUNTIME_NOOP, except no runtime effect is caused by resolving a function or method tagged with \c NOOP at runtime; this tag only affects parse time resolution.
@subsection RUNTIME_NOOP RUNTIME_NOOP
Code with this flag makes no calculations, but rather returns a constant value. This flag is given to function and method variants that return a default value depending on the type of argument(s). When variants with this flag are resolved at parse time, a \c "call-with-type-errors" warning is raised (assuming this warning is enabled), unless \c PO_REQUIRE_TYPES or \c PO_STRICT_ARGS is set. If \c PO_REQUIRE_TYPES or \c PO_STRICT_ARGS is set, then these variants are inaccessible; resolving to a variant with this flag set at parse time or run time causes an exception to be thrown.
These variants are included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
This tag is equal to @ref NOOP, except that \c RUNTIME_NOOP is also enforced at runtime.
@subsection RET_VALUE_ONLY RET_VALUE_ONLY
This flag indicates that the function or method has no side effects; it only returns a value, for example.
This tag is identical to @ref CONSTANT except that functions or methods tagged with \c RET_VALUE_ONLY could throw exceptions.
@subsection CONSTANT CONSTANT
This flag indicates that the function or method has no side effects and does not throw any exceptions.
This tag is identical to @ref RET_VALUE_ONLY except that functions or methods tagged with \c CONSTANT do not throw exceptions.
@subsection DEPRECATED DEPRECATED
Code with this flag is deprecated and may be removed in a future version of this module; if a variant with this flag is resolved at parse time, a \c "deprecated" warning is raised (assuming this warning is enabled).
@section xmlreleasenotes Release Notes
@subsection xml13 xml Module Version 1.3