Name

XPathExpression: a compiled XPath query — Firefox 1.0, Safari 2.01, Opera 9: Object → XPathExpression

Methods

evaluate( )

Evaluates this expression for a specified context node.

Description

An XPathExpression object is a compiled representation of an XPath query, returned by Document.createExpression( ). Evaluate the expression against a particular document node with the evaluate( ) method. If you need to evaluate an XPath query only once, you can use Document.evaluate( ), which compiles and evaluates the expression in a single step.

Internet Explorer does not support the XPathExpression object. For IE-specific XPath methods, see Node.selectNodes( ) and Node.selectSingleNode( ).

See Also

Document.createExpression( )
Document.evaluate( )
Node.selectNodes( )
Node.selectSingleNode( )
Chapter 21

Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.