XML.createTextNode()
Availability
Flash Media Server 2.
Usage
my_xml.createTextNode(text)
Parameters
A string; the text used to create the new text node.
text
Returns
An XML node.
Description
Method; creates a new XML text node with the specified text. The new node initially has no
parent, and text nodes cannot have children or siblings. This method returns a reference to
the XML object that represents the new text node. This method and the
method are the constructor methods for creating nodes for an XML
XML.createElement()
object.
Example
The following example creates two XML text nodes using the
method
createTextNode()
and places them into existing XML nodes:
// Create an XML document.
var doc = new XML();
// Create three XML nodes using createElement().
var element1 = doc.createElement("element1");
var element2 = doc.createElement("element2");
var element3 = doc.createElement("element3");
// Place the new nodes into the XML tree.
doc.appendChild(element1);
element1.appendChild(element2);
element1.appendChild(element3);
// Create two XML text nodes using createTextNode().
var textNode1 = doc.createTextNode("textNode1");
var textNode2 = doc.createTextNode("textNode2");
// Place the new nodes into the XML tree.
element2.appendChild(textNode1);
element3.appendChild(textNode2);
XML class
179
Need help?
Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?