User Guide

XML class 217
XML.xmlDecl
Availability
Flash Media Server 2.
Usage
my_xml.xmlDecl
Description
Property; a string that specifies information about a document’s XML declaration. After the
XML document is parsed into an XML object, this property is set to the text of the
document’s XML declaration. This property is set using a string representation of the XML
declaration, not an XMLNode object. If no XML declaration is encountered during a parse
operation, the property is set to
undefined.XML. The XML.toString() method outputs the
contents of the
XML.xmlDecl property before any other text in the XML object. If the
XML.xmlDecl property contains the undefined type, no XML declaration is output.
Example
The following example loads an XML file and outputs information about the file:
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success)
{
if (success)
{
trace("xmlDecl: " + my_xml.xmlDecl);
trace("contentType: " + my_xml.contentType);
trace("docTypeDecl: " + my_xml.docTypeDecl);
trace("packet: " + my_xml.toString());
}
else
{
trace("Unable to load remote XML.");
}
}
my_xml.load("http://foo.com/crossdomain.xml");
See also
XML.docTypeDecl, XML.toString()