JavaScript: The Definitive Guide

25.331. XPathExpression.evaluate( ): evaluate a compiled XPath query

25.331.1. Synopsis

XPathResult evaluate(Node contextNode, short type, XPathResult result)

25.331.1.1. 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 null to have the evaluate( ) method create and return a new XPathResult object.

25.331.1.2. 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.

25.331.2. 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.

25.331.3. See Also

Document.evaluate( ), Node.selectNodes( ), XPathResult; Chapter 21

Категории