Xml
Cross-platform Xml API.
Static Members
Element: XmlTypeXML element type.
PCData: XmlTypeXML parsed character data type.
CData: XmlTypeXML character data type.
Comment: XmlTypeXML comment type.
DocType: XmlTypeXML doctype element type.
ProcessingInstruction: XmlTypeXML processing instruction type.
Document: XmlTypeXML document type.
Parses the String into an Xml document.
| Name | Type |
|---|---|
str |
String |
| Returns |
|---|
| Xml |
Creates a node of the given type.
| Name | Type |
|---|---|
name |
String |
| Returns |
|---|
| Xml |
Creates a node of the given type.
| Name | Type |
|---|---|
data |
String |
| Returns |
|---|
| Xml |
Creates a node of the given type.
| Name | Type |
|---|---|
data |
String |
| Returns |
|---|
| Xml |
Creates a node of the given type.
| Name | Type |
|---|---|
data |
String |
| Returns |
|---|
| Xml |
Creates a node of the given type.
| Name | Type |
|---|---|
data |
String |
| Returns |
|---|
| Xml |
Creates a node of the given type.
| Name | Type |
|---|---|
data |
String |
| Returns |
|---|
| Xml |
createDocument(): XmlCreates a node of the given type.
| Returns |
|---|
| Xml |
Instance Members
nodeType: XmlTypeReturns the type of the Xml Node. This should be used before accessing other functions since some might raise an exception if the node type is not correct.
nodeName: StringReturns the node name of an Element.
nodeValue: StringReturns the node value. Only works if the Xml node is not an Element or a Document.
parent: XmlReturns the parent object in the Xml hierarchy.
The parent can be null, an Element or a Document.
Get the given attribute of an Element node. Returns null if not found.
Attributes are case-sensitive.
| Name | Type |
|---|---|
att |
String |
| Returns |
|---|
| String |
Set the given attribute value for an Element node. Attributes are case-sensitive.
| Name | Type |
|---|---|
att |
String |
value |
String |
Tells if the Element node has a given attribute. Attributes are case-sensitive.
| Name | Type |
|---|---|
att |
String |
| Returns |
|---|
| Bool |
attributes(): IteratorReturns an Iterator on all the attribute names.
| Returns |
|---|
| Iterator |
iterator(): IteratorReturns an iterator of all child nodes. Only works if the current node is an Element or a Document.
| Returns |
|---|
| Iterator |
elements(): IteratorReturns an iterator of all child nodes which are Elements. Only works if the current node is an Element or a Document.
| Returns |
|---|
| Iterator |
Returns an iterator of all child nodes which are Elements with the given nodeName. Only works if the current node is an Element or a Document.
| Name | Type |
|---|---|
name |
String |
| Returns |
|---|
| Iterator |
firstElement(): XmlReturns the first child node which is an Element.
| Returns |
|---|
| Xml |
Adds a child node to the Document or Element.
A child node can only be inside one given parent node, which is indicated by the parent property.
If the child is already inside this Document or Element, it will be moved to the last position among the Document or Element's children.
If the child node was previously inside a different node, it will be moved to this Document or Element.
| Name | Type |
|---|---|
x |
Xml |
Removes a child from the Document or Element. Returns true if the child was successfuly removed.
| Name | Type |
|---|---|
x |
Xml |
| Returns |
|---|
| Bool |
toString(): StringReturns a String representation of the Xml node.
| Returns |
|---|
| String |
Private Members
attributeMap: MapensureElementType(): Void| Name | Type |
|---|---|
nodeType |
XmlType |