For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Interface XPathResult
ANY_TYPE: 0;
ANY_UNORDERED_NODE_TYPE: 8;
BOOLEAN_TYPE: 3;
booleanValue: boolean;
FIRST_ORDERED_NODE_TYPE: 9;
invalidIteratorState: boolean;
NUMBER_TYPE: 1;
numberValue: number;
ORDERED_NODE_ITERATOR_TYPE: 5;
ORDERED_NODE_SNAPSHOT_TYPE: 7;
resultType: number;
singleNodeValue: Node | null;
snapshotLength: number;
STRING_TYPE: 2;
stringValue: string;
UNORDERED_NODE_ITERATOR_TYPE: 4;
UNORDERED_NODE_SNAPSHOT_TYPE: 6;
iterateNext(): Node | null;
snapshotItem(index: number): Node | null;
}
Index
Properties
Methods
Properties
ReadonlyANY_TYPE
ReadonlyANY_UNORDERED_NODE_TYPE
ReadonlyBOOLEAN_TYPE
ReadonlybooleanValue
The read-only booleanValue property of the XPathResult interface returns the boolean value of a result with XPathResult.resultType being BOOLEAN_TYPE.
ReadonlyFIRST_ORDERED_NODE_TYPE
ReadonlyinvalidIteratorState
The read-only invalidIteratorState property of the XPathResult interface signifies that the iterator has become invalid. It is true if XPathResult.resultType is UNORDERED_NODE_ITERATOR_TYPE or ORDERED_NODE_ITERATOR_TYPE and the document has been modified since this result was returned.
ReadonlyNUMBER_TYPE
ReadonlynumberValue
The read-only numberValue property of the XPathResult interface returns the numeric value of a result with XPathResult.resultType being NUMBER_TYPE.
ReadonlyORDERED_NODE_ITERATOR_TYPE
ReadonlyORDERED_NODE_SNAPSHOT_TYPE
ReadonlyresultType
The read-only resultType property of the XPathResult interface represents the type of the result, as defined by the type constants.
ReadonlysingleNodeValue
The read-only singleNodeValue property of the XPathResult interface returns a Node value or null in case no node was matched of a result with XPathResult.resultType being ANY_UNORDERED_NODE_TYPE or FIRST_ORDERED_NODE_TYPE.
ReadonlysnapshotLength
The read-only snapshotLength property of the XPathResult interface represents the number of nodes in the result snapshot.
ReadonlySTRING_TYPE
ReadonlystringValue
The read-only stringValue property of the XPathResult interface returns the string value of a result with XPathResult.resultType being STRING_TYPE.
ReadonlyUNORDERED_NODE_ITERATOR_TYPE
ReadonlyUNORDERED_NODE_SNAPSHOT_TYPE
Methods
iterateNext
-
The
iterateNext()method of the XPathResult interface iterates over a node set result and returns the next node from it or null if there are no more nodes.Returns Node | null
snapshotItem
-
The
snapshotItem()method of the XPathResult interface 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.Parameters
- index: number
Returns Node | null
The
XPathResultinterface represents the results generated by evaluating an XPath expression within the context of a given node.MDN Reference