haXe

Xml

extern class XmlAvailable in flash, flash9, neko, js, phpThe standard Xml class and parsing. More API to manipulate XML are available in the haxe.xml package. var nodeName(getNodeName,setNodeName) : StringReturns the node name of an Element. var nodeType(default,null) : 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. var nodeValue(getNodeValue,setNodeValue) : StringReturns the node value. Only works if the Xml node is not an Element or a Document. var parent(getParent,null) : XmlReturns the parent object in the Xml hierarchy. The parent can be null, an Element or a Document. function addChild( x : Xml ) : VoidAdds a child node to the Document or Element. One node can only be inside one given node which is indicated by the parent property. function attributes() : Iterator<String>Returns an Iterator on all the attributes values. function 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. function 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. function exists( att : String ) : BoolTells if the Element node has a given attribute. Attributes are case-sensitive. function firstChild() : XmlReturns the first child node. function firstElement() : XmlReturns the first child node which is an Element. function get( att : String ) : StringGet the given attribute of an Element node. Returns null if not found. Attributes are case-sensitive. function insertChild( x : Xml, pos : Int ) : VoidInserts a child at the given position among the other childs. function iterator() : Iterator<Xml>Returns an iterator of all child nodes. Only works if the current node is an Element or a Document. function remove( att : String ) : VoidRemoves an attribute for an Element node. Attributes are case-sensitive. function removeChild( x : Xml ) : BoolRemoves a child from the Document or Element. Returns true if the child was successfuly removed. function set( att : String, value : String ) : VoidSet the given attribute value for an Element node. Attributes are case-sensitive. function toString() : StringReturns a String representation of the Xml node. static var CData(default,null) : XmlTypeA type of Xml node. static var Comment(default,null) : XmlTypeA type of Xml node. static var DocType(default,null) : XmlTypeA type of Xml node. static var Document(default,null) : XmlTypeA type of Xml node. static var Element(default,null) : XmlTypeA type of Xml node. static var PCData(default,null) : XmlTypeA type of Xml node. static var Prolog(default,null) : XmlTypeA type of Xml node. static function createCData( data : String ) : XmlCreates a node of the given type. static function createComment( data : String ) : XmlCreates a node of the given type. static function createDocType( data : String ) : XmlCreates a node of the given type. static function createDocument() : XmlCreates a node of the given type. static function createElement( name : String ) : XmlCreates a node of the given type. static function createPCData( data : String ) : XmlCreates a node of the given type. static function createProlog( data : String ) : XmlCreates a node of the given type. static function parse( s : String ) : XmlParse a String into an Xml object.
version #2489, modified 2008-07-28 10:02:53 by api