
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
133
<simplenode xmlns="http://www.w3.org/2001/12/soap-envelope">
<innernode/>
</simplenode>
</rootnode>
The source for the server-side script file contains the following code (note the comments for the Output strings). The
rootNode node does not have a default namespace, so its namespaceURI value is an empty string. The simpleNode
node defines a default namespace, so its
namespaceURI value is the default namespace. The innerNode node does
not define a default namespace, but uses the default namespace defined by
simpleNode, so its namespaceURI value
is the same as that of
simpleNode.
var xmlDoc = new XML()
xmlDoc.load("http://www.example.com/NoPrefix.xml");
xmlDoc.ignoreWhite = true;
xmlDoc.onLoad = function(success) {
var rootNode = xmlDoc.childNodes[0];
trace("rootNode Node namespaceURI: " + rootNode.namespaceURI);
// Output: [empty string]
var simpleNode = xmlDoc.childNodes[0].childNodes[0];
trace("simpleNode Node namespaceURI: " + simpleNode.namespaceURI);
// Output: ... http://www.w3.org/2001/12/soap-envelope
var innerNode = xmlDoc.childNodes[0].childNodes[0].childNodes[0];
trace("innerNode Node namespaceURI: " + innerNode.namespaceURI);
// Output: ... http://www.w3.org/2001/12/soap-envelope
};
XML.nextSibling
my_xml.nextSibling
Read-only; an XMLNode value that references the next sibling in the parent node’s child list. If the node does not
have a next sibling node, this property is
null. This property cannot be used to manipulate child nodes; use the
appendChild(), insertBefore(), and removeNode() methods to manipulate child nodes.
Availability
Flash Media Server 2
Example
The following example is an excerpt from the example for the
XML.firstChild property. It shows how you can use
the
XML.nextSibling property to loop through an XMLNode object’s child nodes.
for (var aNode = rootNode.firstChild; aNode != null; aNode = aNode.nextSibling) {
trace(aNode);
}
XML.nodeName
my_xml.nodeName
A string representing the node name of the XML object. If the XML object is an XML element (nodeType==1),
nodeName is the name of the tag that represents the node in the XML file. For example, TITLE is the node name of
an HTML
TITLE tag. If the XML object is a text node (nodeType==3), nodeName is null.
Availability
Flash Media Server 2
Commenti su questo manuale