May 2001
Intermediate to advanced
720 pages
23h 24m
English
XML.docTypeDecl Property — the document’s DOCTYPE tag
Flash 5
XMLdoc.docTypeDecl
Read/write
The docTypeDecl string property specifies the
DOCTYPE tag of XMLdoc,
if any exists. Otherwise, docTypeDecl is
undefined . 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 DTD
used to validate the document. ActionScript does not perform
validation of XML documents; it merely parses them. We use the
DOCTYPE tag to build XML documents that may be
validated externally or to identify the type of a loaded XML
document.
var myXML = new XML('<?xml version="1.0"?><!DOCTYPE foo SYSTEM "bar.dtd">'
+ '<P>a short document</P>');
trace(myXML.docTypeDecl); // Displays: "<!DOCTYPE foo SYSTEM "bar.dtd">"
// Set a new DOCTYPE
myXML.docTypeDecl = '<!DOCTYPE baz SYSTEM "bam.dtd">';
XML
.xmlDecl
Read now
Unlock full access