
XML.contentType Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
924
|
ActionScript Language Reference
appendChild() or insertBefore(). The following example clones the first paragraph of a
document to make a sibling paragraph with the same structure:
// Create a new document
myDoc = new XML('<P>paragraph 1</P>');
// Make a clone of the first paragraph
newP = myDoc.firstChild.cloneNode(true);
// Customize the clone
newP.firstChild.nodeValue = "paragraph 2";
// Add the clone into the document
myDoc.appendChild(newP);
trace(myDoc); // Displays: "<P>paragraph 1</P><P>paragraph 2</P>"
Note that the text in an element is stored in a separate child node of that element, so we
must set
deep to true to preserve an element’s text content in a clone operation. Remember
that cloneNode() does not insert the element it returns into the node’s hierarchy—we must
do that ourselves using appendChild() or insertBefore().
See Also
XML.appendChild(), XML.createElement(), XML.createTextNode(), XML.insertBefore()
XML.contentType Property
MIME content type for XML data sent via XML.send() and XML.sendAndLoad()
Flash 5.0.41.0
read/write
xmlDoc.contentType
Description
The contentType property is the MIME type that is sent to a server when XML.send() or
XML.sendAndLoad() is invoked. It defaults to
"application/x-www-form-urlencoded", but
that MIME type is used