
XML.previousSibling Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
943
Usage
Note that in Flash 6, a carriage return in an attribute value causes a parsing error of status
–8 (attribute not terminated). For loaded XML, offending returns can be replaced manu-
ally inside the onData() handler.
Example
We can use parseXML() as a means of replacing the current object hierarchy in an XML
object with a new hierarchy based on internally composed XML source code (for example,
some user input). In the following example, we create a simple XML message by combining
markup with input from text fields named
username_txt and content_txt:
myDoc = new XML();
myXMLsource = "<MESSAGE><USER>" + username_txt + "</USER><CONTENT>"
+ content_txt + "</CONTENT></MESSAGE>";
myDoc.parseXML(myXMLsource);
See Also
XML.ignoreWhite, XML.load(), XML.nodeValue, XML.onData(), XML.status, XML.toString()
XML.previousSibling Property
a reference to the node before this node
Flash 5
read-only
theNode.previousSibling
Description
The previousSibling property returns a reference to the node object preceding theNode in
the current level of the XML object hierarchy (
theNode can be an XML or XMLnode
instance). If there is no node before
theNode in the current level of the hierarchy, it returns
null.
In the following XML source fragment, the
previousSibling ...