klyn.io.xml.xpath.DOMXPathEvaluator.evaluate
method

    public evaluate(expression as String, contextNode as Node, resolver as XPathNSResolver, type as Int, result as XPathResult) as XPathResult throws XPathException, DOMException:

Description

Evaluates an XPath expression.

Parameters

- expression XPath expression text.
- contextNode Context node.
- resolver Namespace resolver, or `null`.
- type Requested `XPathResult` type.
- result Reusable result object, or `null`.

Returns

XPath result.

Throws

- XPathException if evaluation fails.
- DOMException if the context node is invalid.

Example

    result = evaluator.evaluate("string(//title)", document, null, XPathResult.STRING_TYPE, null)