Available on all platforms
Cross-platform Xml API.
See also:
staticread onlyCData:XmlType = XmlType.CDataXML character data type.
staticread onlyComment:XmlType = XmlType.CommentXML comment type.
staticread onlyDocType:XmlType = XmlType.DocTypeXML doctype element type.
staticread onlyDocument:XmlType = XmlType.DocumentXML document type.
staticread onlyElement:XmlType = XmlType.ElementXML element type.
staticread onlyPCData:XmlType = XmlType.PCDataXML parsed character data type.
staticread onlyProcessingInstruction:XmlType = XmlType.ProcessingInstructionXML processing instruction type.
staticcreateCData(data:String):XmlCreates a node of the given type.
staticcreateComment(data:String):XmlCreates a node of the given type.
staticcreateDocType(data:String):XmlCreates a node of the given type.
staticcreateDocument():XmlCreates a node of the given type.
staticcreateElement(name:String):XmlCreates a node of the given type.
staticcreatePCData(data:String):XmlCreates a node of the given type.
staticcreateProcessingInstruction(data:String):XmlCreates a node of the given type.
staticparse(str:String):XmlParses the String into an Xml document.
nodeName:StringReturns the node name of an Element.
read onlynodeType: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.
nodeValue:StringReturns the node value. Only works if the Xml node is not an Element or a Document.
read onlyparent:XmlReturns the parent object in the Xml hierarchy. The parent can be null, an Element or a Document.
addChild(x:Xml):VoidAdds 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.
attributes():Iterator<String>Returns an Iterator on all the attribute names.
elements():Iterator<Xml>Returns an iterator of all child nodes which are Elements. Only works if the current node is an Element or a Document.
elementsNamed(name:String):Iterator<Xml>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.
exists(att:String):BoolTells if the Element node has a given attribute. Attributes are case-sensitive.
inlinefirstChild():XmlReturns the first child node.
firstElement():XmlReturns the first child node which is an Element.
get(att:String):StringGet the given attribute of an Element node. Returns null if not found. Attributes are case-sensitive.
insertChild(x:Xml, pos:Int):VoidInserts a child at the given position among the other childs. 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 new 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.
inlineiterator():Iterator<Xml>Returns an iterator of all child nodes. Only works if the current node is an Element or a Document.
remove(att:String):VoidRemoves an attribute for an Element node. Attributes are case-sensitive.
removeChild(x:Xml):BoolRemoves a child from the Document or Element. Returns true if the child was successfuly removed.
set(att:String, value:String):VoidSet the given attribute value for an Element node. Attributes are case-sensitive.
inlinetoString():StringReturns a String representation of the Xml node.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/Xml.html