User Guide

XMLNode 1339
Parameters
type:Number - An integer representing the node type:
In Flash Player, the XML class only supports node types 1 (ELEMENT_NODE) and 3
(TEXT_NODE).
value:String - For a text node, this is the text of the node; for an element node, this is the
contents of the tag.
Example
var ELEMENT_NODE:Number = 1;
var node1:XMLNode = new XMLNode(ELEMENT_NODE, "fullName");
var TEXT_NODE:Number = 3;
var node2:XMLNode = new XMLNode(TEXT_NODE, "Justin Case");
// Create a new XML document
var doc:XML = new XML();
// Create a root node
var rootNode:XMLNode = doc.createElement("root");
// Add the rootNode as the root of the XML document tree
doc.appendChild(rootNode);
// Build the rest of the document:
Integer value Defined constant
1ELEMENT_NODE
2 ATTRIBUTE_NODE
3TEXT_NODE
4 CDATA_SECTION_NODE
5 NTITY_REFERENCE_NODE
6ENTITY_NODE
7 PROCESSING_INSTRUCTION_NO
DE
8 COMMENT_NODE
9DOCUMENT_NODE
10 DOCUMENT_TYPE_NODE
11 DOCUMENT_FRAGMENT_NODE
12 NOTATION_NODE