Xml
Library for parsing XML. The underlying implementation is a common implementation that is translated to the various target platforms, so parsing is consistent between platforms and not prone to library-specific quirks.
- namespace Xml
enum NodeType[link]
Enum for identifying the type of a parse node
Name | Description |
---|---|
ELEMENT | |
TEXT | |
COMMENT |
enum XmlOption[link]
A bit mask of various options used by the parser.
Name | Description |
---|---|
TRIM_WHITESPACE | Trims the whitespace off text elements. |
FAIL_SILENTLY | If there is a syntax error, return null instead of throwing an exception |
NAMESPACES | Return an XML-namespace aware parse node tree instead of a strict literal parse tree. |
function parse(xmlString, options)[link]
Parses a string and returns an XML node tree. Capable of parsing the tree by the basic XML standard without namespaces, or with. See Xml.XmlOption.
Arguments
Name | Type | Optional | Description |
---|---|---|---|
xmlString | string | Some XML |
|
options | Xml.XmlOption | Optional | A bitmask of extra options for the parser. |
class XmlElement[link]
Represents an XML Element
Fields
class XmlNamespacedAttribute[link]
Represents an attribute in an XML element with namespace information. This is only used if the XML is parsed with the NAMESPACES flag. Otherwise the element contains a simple string-to-string dictionary.
class XmlNamespacedElement[link]
Represents an XML Element along with resolved namespace information
Fields
class XmlText[link]
Represents a blob of text present in an XML file, either as the body of an element or text between elements.