XPathAPI class

ActionScript Class Name mx.xpath.XPathAPI

The XPathAPI class allows you to do simple XPath searches within Adobe Flash. This can be very useful for searching XML packets based on node names and attribute values. In other words, you can quickly find nodes and attributes in an XML document using the XpathAPI methods.

NOTE

The XPathAPI class is supported only if you are working in a document that specifies ActionScript 2.0 in its Publish Settings.

In order to use XPath searches within Flash, you first need to include the XPathAPI class into your Flash library by adding the DataBindingClass (if it hasn't been added already). If you've already set up bindings, this class may have been included automatically; otherwise, you need to select the class from the common libraries (Window > Common Libraries > Classes). From the Classes.fla library panel, you can simply drag a copy of the DataBindingClasses component into your current Flash document's library. Now, you can import the class by typing import mx.xpath.XPathAPI or by using the classes fully qualified name when accessing its methods by prefixing the class methods with mx.xpath.XPathAPI.method_name.

For more information about this class, see the Flash Documentation Resource Center at www.adobe.com/go/xpathapi.