Name
XPathResult.iterateNext( ): return the next node that matches an XPath query
Synopsis
Node iterateNext( )
throws DOMExceptionReturns
Returns the next node in the list of matching nodes, or
null if there are no
more.
Throws
This method throws an exception if the document has been
modified since the XPathResult was returned. It also throws an
exception if called when returnType is not UNORDERED_NODE_ITERATOR_TYPE or ORDERED_NODE_ITERATOR_TYPE.
Description
iterateNext( ) returns the
next node that matches the XPath query or null if all matching nodes have already
been returned. Use this method if resultType is UNORDERED_NODE_ITERATOR_TYPE or ORDERED_NODE_ITERATOR_TYPE. If the type is
ordered, nodes are returned in the order they appear in the
document. Otherwise, they can be returned in any order.
If the invalidIteratorState
property is true, the document
has been modified, and this method throws an exception.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access