Name
XPathExpression.evaluate( ): evaluate a compiled XPath query
Synopsis
XPathResult evaluate(NodecontextNode, shorttype, XPathResultresult)
Arguments
-
contextNode The node (or document) against which the query should be evaluated.
-
type The desired result type. This argument should be one of the constants defined by XPathResult.
-
result An XPathResult object into which the results of the query should be stored, or
nullto have theevaluate( )method create and return a new XPathResult object.
Returns
An XPathResult that hold the results of the query. This is
either the object passed as the result
argument or a newly created XPathResult object if
result was null.
Description
This method evaluates the XPathExpression against a specified
node or document and returns the results in an XPathResult object.
See XPathResult for details on
how to extract values from the returned object.
See Also
Document.evaluate( ),
Node.selectNodes( ), XPathResult; Chapter 21
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access