May 2001
Intermediate to advanced
720 pages
23h 24m
English
XML.xmlDecl Property — the document’s XML declaration tag
Flash 5
XMLdoc.xmlDecl
Read/write
The xmlDecl string property represents the XML
declaration tag of XMLdoc, if any exists.
Otherwise, xmlDecl is undefined . XMLdoc must be the top-level
node in an XML object hierarchy (that is, an
instance of the XML class, not the
XMLnode class.)
The XML declaration tag of an XML document is used to identify the version of XML being used in the document. We use the XML declaration tag to build well-formed XML documents that may be validated externally.
// A well-formed document (but not validated against a DTD)
myXML = new XML('<?xml version="1.0"?><P>this is a short document</P>');
trace(myXML.xmlDecl); // Displays: "<?xml version="1.0"?>"
// Set a new XML declaration
myXML.xmlDecl = '<?xml version="1.0" standalone="no"?>';
XML
.docTypeDecl
Read now
Unlock full access