XPathResult
interfacein packageorg.w3c.dom.xpath
public interface XPathResult:
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)

Fields
Modifier and Type Member Description
public static readonly ANY_TYPE
ANY_TYPE as Int = 0
Type is inferred from the expression result.
public static readonly ANY_UNORDERED_NODE_TYPE
ANY_UNORDERED_NODE_TYPE as Int = 8
Any single node result.
public static readonly BOOLEAN_TYPE
BOOLEAN_TYPE as Int = 3
Boolean result type.
public static readonly FIRST_ORDERED_NODE_TYPE
FIRST_ORDERED_NODE_TYPE as Int = 9
First single node result in document order.
public static readonly NUMBER_TYPE
NUMBER_TYPE as Int = 1
Numeric result type.
public static readonly ORDERED_NODE_ITERATOR_TYPE
ORDERED_NODE_ITERATOR_TYPE as Int = 5
Node iterator result in document order.
public static readonly ORDERED_NODE_SNAPSHOT_TYPE
ORDERED_NODE_SNAPSHOT_TYPE as Int = 7
Node snapshot result in document order.
public static readonly STRING_TYPE
STRING_TYPE as Int = 2
String result type.
public static readonly UNORDERED_NODE_ITERATOR_TYPE
UNORDERED_NODE_ITERATOR_TYPE as Int = 4
Node iterator result without document-order guarantee.
public static readonly UNORDERED_NODE_SNAPSHOT_TYPE
UNORDERED_NODE_SNAPSHOT_TYPE as Int = 6
Node snapshot result without document-order guarantee.
Properties
Modifier and Type Member Description
public readonly property booleanValue
booleanValue as Boolean
Boolean value of a `BOOLEAN_TYPE` result.
public readonly property invalidIteratorState
invalidIteratorState as Boolean
True when an iterator result has been invalidated by document mutation.
public readonly property numberValue
numberValue as Double
Numeric value of a `NUMBER_TYPE` result.
public readonly property resultType
resultType as Int
Actual result type.
public readonly property singleNodeValue
singleNodeValue as Node
Single node value of `ANY_UNORDERED_NODE_TYPE` or `FIRST_ORDERED_NODE_TYPE` results.
public readonly property snapshotLength
snapshotLength as Int
Number of nodes in a snapshot result.
public readonly property stringValue
stringValue as String
String value of a `STRING_TYPE` result.
Methods
Modifier and Type Member Description
public iterateNext
iterateNext() as Node throws XPathException, DOMException
Returns the next node from an iterator result.
public snapshotItem
snapshotItem(index as Int) as Node throws XPathException
Returns a node from a snapshot result.