Struct XMLParser

Low-level class for creating parsers for url=https://en.wikipedia.org/wiki/XMLXML/url files.

struct XMLParser ;

This class can serve as base to make custom XML parsers. Since XML is a very flexible standard, this interface is low-level so it can be applied to any possible schema.

Methods

NameDescription
getAttributeCount Gets the amount of attributes in the current element.
getAttributeName Gets the name of the attribute specified by the index in idx argument.
getAttributeValue Gets the value of the attribute specified by the index in idx argument.
getCurrentLine Gets the current line in the parsed file (currently not implemented).
getNamedAttributeValue Gets the value of a certain attribute of the current element by name. This will raise an error if the element has no such attribute.
getNamedAttributeValueSafe Gets the value of a certain attribute of the current element by name. This will return an empty String if the attribute is not found.
getNodeData Gets the contents of a text node. This will raise an error in any other type of node.
getNodeName Gets the name of the current element node. This will raise an error if the current node type is neither constant NODE_ELEMENT nor constant NODE_ELEMENT_END.
getNodeOffset Gets the byte offset of the current node since the beginning of the file or buffer.
getNodeType Gets the type of the current node. Compare with nodetype constants.
hasAttribute Check whether the current element has a certain attribute.
isEmpty Check whether the current element is empty (this only works for completely empty tags, e.g. <element \>).
open Opens an XML file for parsing. This returns an error code.
openBuffer Opens an XML raw buffer for parsing. This returns an error code.
read Reads the next node of the file. This returns an error code.
seek Moves the buffer cursor to a certain offset (since the beginning) and read the next node there. This returns an error code.
skipSection Skips the current section. If the node contains other elements, they will be ignored and the cursor will go to the closing of the current element.

Enums

NameDescription
Constants
NodeType