invalidIteratorState property (XPathResult)
Retrieves whether the iterator of the current XPathResult object is valid or not.
The XPathResult object represents the result of the evaluate method.
The type of the result depends on the fourth parameter of the evaluate method, or, if its value is ANY_TYPE, on the expression specified by the first parameter. With the resultType property, the type of the result can be retrieved.If the value of the resultType property is UNORDERED_NODE_ITERATOR_TYPE or ORDERED_NODE_ITERATOR_TYPE, then the iterateNext method can be used to retrieve the matching nodes from the result set. In that case, if the document is modified during the iteration, the value of the invalidIteratorState property becomes true. A call to the iterateNext method raises an exception when the iterator is invalid.
You can find the related objects in the Supported by objects section below.
This property is read-only.
Boolean that specifies whether the iterator is valid or not.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the invalidIteratorState property:
Did you find this example helpful?
User Contributed Comments