Handle XML documents.
NOTE: The simplexml module can also be used to parse XML documents.
Availability
| Script Types |
|---|
| All Types |
xml()
Get an XML object, which provides XML reader.
Return value
XML Object
XML Reader
Provided by the XML Object, used to read and parse XML data.
xml:create_reader()
Create an XML reader for a given stream.
Parameters
streamStream object
Return value
XML Reader object
reader:next_node()
Get information about the next node in the XML document.
Return value
Returns two values:
typeInteger; 0 on none or error, 1 on start of XML element, 2 on end of XML element, 3 on textnameName of XML node (not returned whentype<= 0)
reader:next_attr()
Get information about the next attribute in an XML document.
Return value
Returns two values on success nil otherwise:
nameString containing the name of the attributevalueString containing the value of the attribute
reader:node_empty()
Determine whether the previous invocation of reader:next_node() refers to an empty node.
Return value
Integer value: -2 on failure, 1 on empty node, 0 on non-empty node