XML.docTypeDecl Property

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
XML.docTypeDecl Property Flash 5

the document's DOCTYPE tag read/write
xmlDoc.docTypeDecl

Description

The docTypeDecl string property specifies the DOCTYPE tag of xmlDoc, if any exists. Otherwise, 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 declaration (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.

Example

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">';

See Also

XML.xmlDecl



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net