Name
XPathResult: the result of an XPath query — Firefox 1.0; Safari 2.01; Opera 9: Object → XPathResult
Constants
The following constants define the possible types an XPath
query can return. The resultType
property of an XPathResult object holds one of these values to
specify which kind of result the object holds. These constants are
also used with Document.evaluate(
) and XPathExpression.evaluate(
) methods to specify the desired result type. The
constants and their meanings are as follows:
-
ANY_TYPE Passes this value to
Document.evaluate( )orXPathExpression.evaluate( )to specify that any type of result is acceptable. TheresultTypeproperty is never set to this value.-
NUMBER_TYPE numberValueholds the result.-
STRING_TYPE stringValueholds the result.-
BOOLEAN_TYPE booleanValueholds the result.-
UNORDERED_NODE_ITERATOR_TYPE The result is an unordered set of nodes, which can be accessed sequentially by calling
iterateNext( )repeatedly until it returnsnull. The document must not be modified during this iteration.-
ORDERED_NODE_ITERATOR_TYPE The result is a list of nodes, arranged in document order, which can be accessed sequentially by calling
iterateNext( )repeatedly until it returnsnull. The document must not be modified during this iteration.-
UNORDERED_NODE_SNAPSHOT_TYPE The result is a random-access list of nodes. The
snapshotLengthproperty specifies the length of the list, and thesnapshotItem( )method returns the node at a specified index. The nodes may not be in the same ...
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