
XML.docTypeDecl Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
926
|
ActionScript Language Reference
and insert a new P element into a document, and then we give that P element a text-node
child:
myDoc = new XML();
newP = myDoc.createElement("P");
myDoc.appendChild(newP);
newText = myDoc.createTextNode("This is the first paragraph");
myDoc.firstChild.appendChild(newText);
trace(myDoc); // Displays: "<P>This is the first paragraph</P>"
Normally, text nodes are stored as the children of element nodes, which are created using
createElement().
The createTextNode() method converts the characters <, >, &, ', and " according to the
rules of entity conversion discussed under XML.parseXML().
See Also
XML.appendChild(), XML.cloneNode(), XML.createElement(), XML.insertBefore(), XML.
parseXML()
XML.docTypeDecl Property
the document’s DOCTYPE tag
Flash 5
read/write
xmlDoc.docTypeDecl
Description
The docTypeDecl string property specifies the DOCTYPE tag of xmlDoc, if any exists. Other-
wise,
docTypeDecl is undefined. The specified xmlDoc must be the top-level node in an XML
object hierarchy (i.e., an instance of the XML class, not the XMLnode class).
An XML document’s
DOCTYPE specifies the name and location of the document type declara-
tion (DTD) used to validate the document. ActionScript does not perform validation of
XML documents; it merely parses ...