U-X > XML.docTypeDecl |  |

XML.docTypeDecl

XML.doctypedecl, doctypedecl, document type declaration

Availability

Flash Player 5.

Usage

`myXML`.`XMLdocTypeDecl`

Description

Property; sets and returns information about the XML document `DOCTYPE` declaration. After the XML text has been parsed into an XML object, the `XML.docTypeDecl` property of the XML object is set to the text of the XML document's `DOCTYPE` declaration. For example, `<!DOCTYPE greeting SYSTEM "hello.dtd">`. This property is set using a string representation of the `DOCTYPE` declaration, not an XML node object.

ActionScript's XML parser is not a validating parser. The `DOCTYPE` declaration is read by the parser and stored in the `docTypeDecl` property, but no DTD validation is performed.

If no `DOCTYPE` declaration was encountered during a parse operation, `XML.docTypeDecl` is set to undefined. `XML.toString` outputs the contents of `XML.docTypeDecl` immediately after the XML declaration stored in `XML.xmlDecl`, and before any other text in the XML object. If `XML.docTypeDecl` is undefined, no `DOCTYPE` declaration is output.

Example

The following example uses `XML.docTypeDecl` to set the `DOCTYPE` declaration for an XML object:

    myXML.docTypeDecl = "<!DOCTYPE greeting SYSTEM \"hello.dtd\">";

See also

`XML.toString`, `XML.xmlDecl`