CHAPTER 10 USING FLASH TO DISPLAY XML (Free web servers)
CHAPTER 10 USING FLASH TO DISPLAY XML 299 Unlike the XML DOM, ActionScript doesn t include the replaceChild() method. Let s look at each of these methods and properties so you can understand them in more detail. attributes The attributes property returns an object containing all of the attributes of the specified XMLNode object: oXMLNode.attributes You can loop through all attributes within the XMLNode using this code: for (var theAtt:String in oXMLNode.attributes) { ..//process attributes } parentNode The parentNode property returns the XMLNode that is the parent of the current node: oXMLNode.parentNode Remember that attributes don t have a parent node, as they are not the children of their containing element. If the node doesn t have a parent, it returns null. childNodes The childNodes property returns an array of child XMLNode objects: oXMLNode.childNodes You can refer to a specific child node by using its position within the collection: oXMLNode.childNodes[0] The previous line refers to the first child node of the oXMLNode element. You can find out how many child nodes exist within an element by using the length property: oXMLNode.childNodes.length This allows you to loop through the collection: for (var i:Number=0; i < oXMLNode.childNodes.length; i++) { //do something } As text nodes don t have child nodes, this property will return undefined.
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.