MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1329

Actionscript 2.0 language reference
Table of Contents

Advertisement

trace("w:GetTemperature namespaceURI: " + tempNode.namespaceURI);
// Output: ... http://www.example.com/weather
trace("w:GetTemperature soap namespace: " +
tempNode.getNamespaceForPrefix("soap"));
// Output: ... http://www.w3.org/2001/12/soap-envelope
var soapBodyNode:XMLNode = xmlDoc.childNodes[0].childNodes[0];
trace("soap:Envelope namespaceURI: " + soapBodyNode.namespaceURI);
// Output: ... http://www.w3.org/2001/12/soap-envelope
}
The following example uses XML tags without prefixes. It uses a SWF file and an XML file
located in the same directory. The XML file, named
tags.
<?xml version="1.0"?>
<rootnode>
<simplenode xmlns="http://www.w3.org/2001/12/soap-envelope">
<innernode />
</simplenode>
</rootnode>
The source for the SWF file contains the following script (note the comments for the Output
strings). The
rootNode
empty string. The
simpleNode
default namespace. The
namespace defined by
.
simpleNode
var xmlDoc:XML = new XML()
xmlDoc.load("NoPrefix.xml");
xmlDoc.ignoreWhite = true;
xmlDoc.onLoad = function(success:Boolean)
{
var rootNode:XMLNode = xmlDoc.childNodes[0];
trace("rootNode Node namespaceURI: " + rootNode.namespaceURI);
// Output: [empty string]
var simpleNode:XMLNode = xmlDoc.childNodes[0].childNodes[0];
trace("simpleNode Node namespaceURI: " + simpleNode.namespaceURI);
// Output: ... http://www.w3.org/2001/12/soap-envelope
var innerNode:XMLNode = xmlDoc.childNodes[0].childNodes[0].childNodes[0];
trace("innerNode Node namespaceURI: " + innerNode.namespaceURI);
// Output: ... http://www.w3.org/2001/12/soap-envelope
}
does not have a default namespace, so its
defines a default namespace, so its
does not define a default namespace, but uses the default
innerNode
, so its
simpleNode
namespaceURI
contains the following
NoPrefix.xml
namespaceURI
namespaceURI
value is the same as that of
value is an
value is the
XMLNode
1329

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents