XPathResultinterface represents the results generated by evaluating an XPath expression within the context of a given node. Since XPath expressions can result in a variety of result types, this interface makes it possible to determine and handle the type and value of the result.
boolean representing the value of the result if
Signifies that the iterator has become invalid. It is
ORDERED_NODE_ITERATOR_TYPE and the document has been modified since this result was returned.
number representing the value of the result if
number code representing the type of the result, as defined by the type constants.
Node representing the value of the single node result, which may be
NOTE: The returned SuperNode will behave like all AwaitedDom SuperNodes: nothing will be retrieved until you await the node or child property.
await result.singleNodeResult === null; // null if not present await result.singleNodeResult.textContent; // gets text
The number of nodes in the result snapshot.
string representing the value of the result if
If the result is a node set, this method iterates over it and returns the next node from it or
null if there are no more nodes.
NOTE: The iterated SuperNodes will behave like all AwaitedDom SuperNodes: nothing will be retrieved until you await the node or child property.
await result.iterateNext() === null; // null if not present await result.iterateNext().textContent; // gets text
Returns an item of the snapshot collection or
null in case the index is not within the range of nodes. Unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated.
number. Needs content.