User Guide

XML class 207
Example
The following example creates an XML packet and writes the parent node of the username
node to the log file:
var my_xml = new XML("<login><username>morton</username>
<password>good&amp;evil</password></login>");
// The first child is the <login /> node.
var rootNode = my_xml.firstChild;
// The first child of the root is the <username /> node.
var targetNode = rootNode.firstChild;
trace("the parent node of '"+targetNode.nodeName+"' is:
"+targetNode.parentNode.nodeName);
trace("contents of the parent node are:\n"+targetNode.parentNode);
/* output (line breaks added for clarity):
the parent node of 'username' is: login
contents of the parent node are:
<login>
<username>morton</username>
<password>good&amp;evil</password>
</login>
*/
See also
XML.appendChild(), XML.insertBefore(), XML.removeNode()
XML.parseXML()
Availability
Flash Media Server 2.
Usage
my_xml.parseXML(source)
Parameters
source A string; the XML text to be parsed and passed to the specified XML object.
Returns
Nothing.
NOTE
In Flash Media Server, the output of trace() statements appears in the application log
file and Application inspector.