Section 25.67. Document.createExpression( ): create an XPath expression for later evaluation


25.67. Document.createExpression( ): create an XPath expression for later evaluation

Firefox 1.0, Safari 2.01, Opera 9:

25.67.1. Synopsis

 XPathExpression createExpression(String xpathText,                                  Function namespaceURLMapper)     throws XPathException 

25.67.1.1. Arguments

xpathText

The string representing the XPath expression to compile.


namespaceURLMapper

A function that will map from a namespace prefix to a full namespace URL, or null if no such mapping is required.

25.67.1.2. Returns

An XPathExpression object.

25.67.1.3. Throws

This method throws an exception if the xpathText contains a syntax error or if it uses a namespace prefix that cannot be resolved by namespaceURLMapper.

25.67.2. Description

This method takes a string representation of an XPath expression and converts it to a compiled representation, an XPathExpression. In addition to the expression, this method takes a function of the form function(prefix) that resolves a namespace prefix string and returns it as a full namespace URL string.

Internet Explorer does not support this API. See Node.selectNodes( ) for an IE-specific alternative.

25.67.3. See Also

Document.evaluate( ), Node.selectNodes( ), XPathExpression, XPathResult




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net