User Guide
198 Server-Side ActionScript Language Reference
XML.nodeName
Availability
Flash Media Server 2.
Usage
my_xml.nodeName
Description
Property; 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 nodeName of an HTML TITLE tag. If the XML
object is a text node (
nodeType==3), nodeName is null.
Example
The following example creates an element node and a text node, and checks the node name of
each:
// Create an XML document.
var doc = new XML();
// Create an XML node using createElement().
var myNode = doc.createElement("rootNode");
// Place the new node into the XML tree.
doc.appendChild(myNode);
// Create an XML text node using createTextNode().
var myTextNode = doc.createTextNode("textNode");
// Place the new node into the XML tree.
myNode.appendChild(myTextNode);
trace(myNode.nodeName);
trace(myTextNode.nodeName);
/*
output:
rootNode
null
*/