XML class
179
XML.createTextNode()
Availability
Flash Media Server 2.
Usage
my_xml
.createTextNode(
text
)
Parameters
text
A string; the text used to create the new text node.
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
XML.createElement()
method are the constructor methods for creating nodes for an XML
object.
Example
The following example creates two XML text nodes using the
createTextNode()
method
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);
Содержание FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT...
Страница 1: ...Server Side ActionScript Language Reference...
Страница 4: ...4 Contents...
Страница 228: ...228 Server Side ActionScript Language Reference...
Страница 234: ...234 Server Side Information Objects...