public interface XPathResult:
Result of evaluating an XPath 1.0 expression.
The Java-style DOM XPath getters are exposed as Klyn properties: result.stringValue, result.snapshotLength, result.singleNodeValue, and so on.
@example `klyn import klyn.io.xml.xpath import org.w3c.dom.xpath
result = DOMXPathEvaluator().evaluate("//item", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null) print(result.snapshotLength)
| Modifier and Type | Member | Description |
|---|---|---|
| public static readonly | ANY_TYPEANY_TYPE as Int = 0 |
Type is inferred from the expression result. |
| public static readonly | ANY_UNORDERED_NODE_TYPEANY_UNORDERED_NODE_TYPE as Int = 8 |
Any single node result. |
| public static readonly | BOOLEAN_TYPEBOOLEAN_TYPE as Int = 3 |
Boolean result type. |
| public static readonly | FIRST_ORDERED_NODE_TYPEFIRST_ORDERED_NODE_TYPE as Int = 9 |
First single node result in document order. |
| public static readonly | NUMBER_TYPENUMBER_TYPE as Int = 1 |
Numeric result type. |
| public static readonly | ORDERED_NODE_ITERATOR_TYPEORDERED_NODE_ITERATOR_TYPE as Int = 5 |
Node iterator result in document order. |
| public static readonly | ORDERED_NODE_SNAPSHOT_TYPEORDERED_NODE_SNAPSHOT_TYPE as Int = 7 |
Node snapshot result in document order. |
| public static readonly | STRING_TYPESTRING_TYPE as Int = 2 |
String result type. |
| public static readonly | UNORDERED_NODE_ITERATOR_TYPEUNORDERED_NODE_ITERATOR_TYPE as Int = 4 |
Node iterator result without document-order guarantee. |
| public static readonly | UNORDERED_NODE_SNAPSHOT_TYPEUNORDERED_NODE_SNAPSHOT_TYPE as Int = 6 |
Node snapshot result without document-order guarantee. |
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | booleanValuebooleanValue as Boolean |
Boolean value of a `BOOLEAN_TYPE` result. |
| public readonly property | invalidIteratorStateinvalidIteratorState as Boolean |
True when an iterator result has been invalidated by document mutation. |
| public readonly property | numberValuenumberValue as Double |
Numeric value of a `NUMBER_TYPE` result. |
| public readonly property | resultTyperesultType as Int |
Actual result type. |
| public readonly property | singleNodeValuesingleNodeValue as Node |
Single node value of `ANY_UNORDERED_NODE_TYPE` or `FIRST_ORDERED_NODE_TYPE` results. |
| public readonly property | snapshotLengthsnapshotLength as Int |
Number of nodes in a snapshot result. |
| public readonly property | stringValuestringValue as String |
String value of a `STRING_TYPE` result. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | iterateNextiterateNext() as Node throws XPathException, DOMException |
Returns the next node from an iterator result. |
| public | snapshotItemsnapshotItem(index as Int) as Node throws XPathException |
Returns a node from a snapshot result. |