DOMXPathExpression
class in package klyn.io.xml.xpath

    public class DOMXPathExpression extends Object implements XPathExpression:

Object
└ DOMXPathExpression
All Implemented Interfaces: XPathExpression

Compiled pure Klyn XPath expression.

The implementation currently targets the DOM XPath 1.0 API and deliberately rejects unsupported syntax with `XPathException.INVALID_EXPRESSION_ERR`.

Example

    import klyn.io.xml.xpath
    import org.w3c.dom.xpath

    expression = DOMXPathExpression("//Spy[@id='007']/Email/text()", null)
    result = expression.evaluate(document, XPathResult.STRING_TYPE, null)
    print(result.stringValue)

Inherited Properties
property Inherited Properties from Object: type
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | DOMXPathExpression `DOMXPathExpression(expression as String, resolver as XPathNSResolver) throws XPathException, DOMException:` | Compiles an XPath expression.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | evaluate `evaluate(contextNode as Node, type as Int, result as XPathResult) as XPathResult throws XPathException, DOMException:` | Evaluates this compiled expression against a context node.

Inherited Methods
method Inherited Methods from Object: deepCopy, fromJson, toDict, toJson, toString, toXml
method Inherited Methods from XPathExpression: evaluate