
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
141
Read-only; the prefix portion of the XML node name. For example, in the node
<contact:mailbox/>
[email protected]</contact:mailbox>,
the prefix contact and the local name mailbox comprise the full element name contact.mailbox.
Availability
Flash Media Server 2
Example
A directory contains a server-side script file and an XML file. The XML file, named SoapSample.xml, contains the
following code:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope">
<soap:Body xmlns:w="http://www.example.com/weather">
<w:GetTemperature>
<w:City>San Francisco</w:City>
</w:GetTemperature>
</soap:Body>
</soap:Envelope>
The source for the server-side script file contains the following code (note the comments for the Output strings):
var xmlDoc = new XML();
xmlDoc.ignoreWhite = true;
xmlDoc.load("http://www.example.com/SoapSample.xml");
xmlDoc.onLoad = function(success) {
var tempNode = xmlDoc.childNodes[0].childNodes[0].childNodes[0];
trace("w:GetTemperature prefix: " + tempNode.prefix); // Output: ... w
var soapEnvNode = xmlDoc.childNodes[0];
trace("soap:Envelope prefix: " + soapEnvNode.prefix); // Output: ... soap
};
XML.previousSibling
my_xml.previousSibling
Read-only; an XMLNode value that references the previous sibling in the parent node’s child list. If the node does
not have a previous sibling node, the property has a value of
null. This property cannot be used to manipulate child
nodes; use the
XML.appendChild(), XML.insertBefore(), and XML.removeNode() methods instead.
Availability
Flash Media Server 2
Example
The following example is an excerpt from the example for the
XML.lastChild property. It shows how you can use
the
XML.previousSibling property to loop through an XMLNode object’s child nodes:
for (var aNode = rootNode.lastChild; aNode != null; aNode = aNode.previousSibling) {
trace(aNode);
}
XML.removeNode()
my_xml.removeNode()
Removes the specified XML object from its parent and deletes all descendants of the node.
Commenti su questo manuale