Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > XMLNode > prefix (XMLNode.prefix property) | |||
public prefix : String [read-only]
The prefix portion of the XML node name. For example, the node <contact:mailbox/>bob@example.com</contact:mailbox> prefix "contact" and the local name "mailbox", which comprise the full element name "contact.mailbox".
The nodeName property of an XML node object returns the full name (including the prefix and the local name). You can access the local name portion of the element's name via the localName property.
Availability: ActionScript 1.0; Flash Player 8
A directory contains a SWF file and an XML file. 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:XML = new XML();
xmlDoc.ignoreWhite = true;
xmlDoc.load("SoapSample.xml");
xmlDoc.onLoad = function(success:Boolean)
{
var tempNode:XMLNode = xmlDoc.childNodes[0].childNodes[0].childNodes[0];
trace("w:GetTemperature prefix: " + tempNode.prefix); // Output: ... w
var soapEnvNode:XMLNode = xmlDoc.childNodes[0];
trace("soap:Envelope prefix: " + soapEnvNode.prefix); // Output: ... soap
}
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002362.html