Flash Lite 2.x and 3.0 ActionScript Language Reference

XML constructor

public XML(text:String)

Creates a new XML object. You must use the constructor to create an XML object before you call any of the methods of the XML class.

Note: Use the createElement() and createTextNode() methods to add elements and text nodes to an XML document tree.

Parameters

text:String - A string; the XML text parsed to create the new XML object.

Example

The following example creates a new, empty XML object:

var my_xml:XML = new XML();

The following example creates an XML object by parsing the XML text specified in the source parameter, and populates the newly created XML object with the resulting XML document tree:

var other_xml:XML = new XML("<state name=\"California\"><city>San Francisco</city></state>");

See also

createElement (XML.createElement method), createTextNode (XML.createTextNode method)