XML.localName
Availability
Flash Media Server 2.
Usage
my_xml.localName
Description
Property (read-only); the local name portion of the XML node's name. This is the element
name without the namespace prefix. For example, the node <contact:mailbox/
>bob@example.com</contact:mailbox> has the local name "mailbox", and the prefix
"contact", which comprise the full element name "contact.mailbox".
You can access the namespace prefix via the
The
property returns the full name (including the prefix and the local name).
XML.nodeName
Example
This example uses a SWF file and an XML file located in the same directory. The XML file,
named "SoapSample.xml" contains the following:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope">
<soap:Body xmlns:w="http://www.example.com/weather">
<w:GetTemperature>
<w:City>San Francisco</w:City>
</w:GetTemperature>
</soap:Body>
</soap:Envelope>
The source for the SWF file contains the following script (note the comments for the Output
strings):
var xmlDoc = new XML()
xmlDoc.ignoreWhite = true;
xmlDoc.load("SoapSample.xml")
xmlDoc.onLoad = function(success)
{
var tempNode = xmlDoc.childNodes[0].childNodes[0].childNodes[0];
trace("w:GetTemperature localname: " + tempNode.localName); // Output:
... GetTemperature
var soapEnvNode = xmlDoc.childNodes[0];
trace("soap:Envelope localname: " + soapEnvNode.localName); // Output:
... Envelope
}
194
Server-Side ActionScript Language Reference
property of the XML node object.
XML.prefix
Need help?
Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?