03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

create an XML document<br />

var doc:XML = new XML();<br />

// create three XML nodes using createElement()<br />

var element1:XMLNode = doc.createElement("element1");<br />

var element2:XMLNode = doc.createElement("element2");<br />

var element3:XMLNode = doc.createElement("element3");<br />

// place the new nodes into the XML tree<br />

doc.appendChild(element1);<br />

element1.appendChild(element2);<br />

element1.appendChild(element3);<br />

// create two XML text nodes using createTextNode()<br />

var textNode1:XMLNode = doc.createTextNode("textNode1 String value");<br />

var textNode2:XMLNode = doc.createTextNode("textNode2 String value");<br />

// place the new nodes into the XML tree<br />

element2.appendChild(textNode1);<br />

element3.appendChild(textNode2);<br />

trace(doc);<br />

// output (with line breaks added between tags):<br />

// <br />

// textNode1 String value<br />

// textNode2 String value<br />

// <br />

See also<br />

createElement (XML.createElement method)<br />

docTypeDecl (XML.docTypeDecl property)<br />

public docTypeDecl : String<br />

Specifies information about the XML document's DOCTYPE declaration. After the XML text<br />

has been parsed into an XML object, the XML.docTypeDecl property of the XML object is set<br />

to the text of the XML document's DOCTYPE declaration (for example, ). This property is set using a string representation of the DOCTYPE<br />

declaration, not an XML node object.<br />

The ActionScript XML parser is not a validating parser. The DOCTYPE declaration is read by<br />

the parser <strong>and</strong> stored in the XML.docTypeDecl property, but no Dtd validation is performed.<br />

682 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!