User Guide
1040 Chapter 2: ActionScript Language Reference
XML.nodeType
Availability
Flash Player 5.
Usage
my_xml.nodeType:Number
Description
Read-only property; a nodeType value, either 1 for an XML element or 3 for a text node.
The
nodeType is a numeric value from the NodeType enumeration in the W3C DOM Level 1
recommendation: www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html.
The following table lists the values:
In Flash Player, the built-in XML class only supports 1 (
ELEMENT_NODE) and 3 (TEXT_NODE).
Example
The following example creates an element node and a text node, and checks the node type of
each:
// create an XML document
var doc:XML = new XML();
// create an XML node using createElement()
var myNode:XMLNode = doc.createElement("rootNode");
// place the new node into the XML tree
doc.appendChild(myNode);
// create an XML text node using createTextNode()
Integer value Defined constant
1
ELEMENT_NODE
2
ATTRIBUTE_NODE
3
TEXT_NODE
4
CDATA_SECTION_NODE
5
ENTITY_REFERENCE_NODE
6
ENTITY_NODE
7
PROCESSING_INSTRUCTION_NODE
8
COMMENT_NODE
9
DOCUMENT_NODE
10
DOCUMENT_TYPE_NODE
11
DOCUMENT_FRAGMENT_NODE
12
NOTATION_NODE