Xml

class XmlAvailable in flash8, flash, neko, js, php, cpp, cs, javaThe standard Xml class and parsing. More API to manipulate XML are available in the haxe.xml package.
Articles with more infomation on Xml: Using Xml
var nodeName(accessor,accessor) : 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(accessor,accessor) : StringReturns the node value. Only works if the Xml node is not an Element or a Document. If the Xml node is an Element, you can use the firstChild() method to acces the value of the node. This value will be of the type Element.
private function getNodeValue(node:Element):String {
  return node.firstChild().toString();
}
var parent(accessor,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 names. 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 children. 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 ProcessingInstruction(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 createProcessingInstruction( data : String ) : XmlCreates a node of the given type. static function parse( str : String ) : XmlParse a String into an Xml object.
version #19316, modified 2013-05-08 11:14:02 by api
0 comment