<h1>XPath2Result Class Reference</h1><!-- doxytag: class="XPath2Result" -->The XPathResult2 interface represents the result of the evaluation of an XPath 2.0 expression within the context of a particular node.
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the result type of this result. <ahref="#99c7a03d8af94716b20ee9b459d8c4e0"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns true if the result has a current result and the value is a node. <ahref="#7ebbdf5df735155dd651afb9766dfc01"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the DOM type info of the current result node or value. <ahref="#e123dc342ef0c418d3bda6f0146d118d"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Conversion of the current result to double. <ahref="#9dab3a3b5f8a7aa40dcf9eb208f68199"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Conversion of the current result to int. <ahref="#b3d50634dba42d7ceece56a108f6ba88"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Conversion of the current result to string. <ahref="#9a780a0e598dfcfaea6a4e18eb6b2dca"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Conversion of the current result to boolean. <ahref="#6a36b40c64d704061c07dd0abe1e7689"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Retrieve the current node value. <ahref="#7777eeaa4031e2f55162f61952bd72be"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Signifies that the iterator has become invalid. <ahref="#03fe13a9c19742f3e9bae278a4090f1b"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">The number of items in the result snapshot. <ahref="#a044508ec4f50445ed5dc7ddd897c8db"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Iterates and returns true if the current result is the next item from the sequence or false if there are no more items. <ahref="#b0eb8f59658545aa61b7dab1c30f5b64"></a><br></td></tr>
<tr><tdclass="memItemLeft"nowrapalign="right"valign="top">virtual bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classXPath2Result.html#e369b3e0ef4e277b26577c3854cd74fe">snapshotItem</a> (unsigned long index)=0</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the current result to the indexth item in the snapshot collection. <ahref="#e369b3e0ef4e277b26577c3854cd74fe"></a><br></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Called to indicate that this object (and its associated children) is no longer in use and that the implementation may relinquish any resources associated with it and its associated children. <ahref="#626c24927dfce8d8bc8162c643ff590c"></a><br></td></tr>
<tr><tdcolspan="2"><br><h2>Protected Member Functions</h2></td></tr>
The XPathResult2 interface represents the result of the evaluation of an XPath 2.0 expression within the context of a particular node.
<p>
Since evaluation of an XPath 2.0 expression can result in various result types, this object makes it possible to discover and manipulate the type and value of the result. <dlcompact><dt><b>Since:</b></dt><dd>DOM Level 3 </dd></dl>
The result is a sequence as defined by XPath 2.0 and will be accessed as a single current value or there will be no current value if the sequence is empty. Document modification does not invalidate the value, but may mean that the result no longer corresponds to the current document. This is a convenience that permits optimization since the implementation can stop once the first item in the resulting sequence has been found. If there is more than one item in the actual result, the single item returned might not be the first in document order. <p>
ITERATOR_RESULT <br>
The result is a sequence as defined by XPath 2.0 that will be accessed iteratively. Document modification invalidates the iteration. <p>
SNAPSHOT_RESULT <br>
The result is a sequence as defined by XPath 2.0 that will be accessed as a snapshot list of values. Document modification does not invalidate the snapshot but may mean that reevaluation would not yield the same snapshot and any items in the snapshot may have been altered, moved, or removed from the document. <dlcompact><dt><b>Enumerator: </b></dt><dd>
If the native double type of the DOM binding does not directly support the exact IEEE 754 result of the XPath expression, then it is up to the definition of the binding to specify how the XPath number is converted to the native binding number. <dlcompact><dt><b>Returns:</b></dt><dd>asDouble of type double, readonly </dd></dl>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>XPathException</em> </td><td>TYPE_ERR: raised if current result cannot be properly converted to double. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>DOMException</em> </td><td>INVALID_STATE_ERR: There is no current result in the result. </td></tr>
<dlcompact><dt><b>Returns:</b></dt><dd>asInt of type int, readonly </dd></dl>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>XPathException</em> </td><td>TYPE_ERR: raised if current result cannot be properly converted to int. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>DOMException</em> </td><td>INVALID_STATE_ERR: There is no current result in the result. </td></tr>
<dlcompact><dt><b>Returns:</b></dt><dd>asString of type DOMString, readonly </dd></dl>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>XPathException</em> </td><td>TYPE_ERR: raised if current result cannot be properly converted to string. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>DOMException</em> </td><td>INVALID_STATE_ERR: There is no current result in the result. </td></tr>
Valid values for snapshotItem indices are 0 to snapshotLength-1 inclusive. <dlcompact><dt><b>Returns:</b></dt><dd>snapshotLength of type unsigned long, readonly </dd></dl>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>XPathException</em> </td><td>TYPE_ERR: raised if resultType is not SNAPSHOT_RESULT. </td></tr>
Iterates and returns true if the current result is the next item from the sequence or false if there are no more items.
<p>
<dlcompact><dt><b>Returns:</b></dt><dd>boolean True if the current result is the next item from the sequence or false if there are no more items. </dd></dl>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>XPathException</em> </td><td>TYPE_ERR: raised if resultType is not ITERATOR_RESULT. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>DOMException</em> </td><td>INVALID_STATE_ERR: The document has been mutated since the result was returned. </td></tr>
Called to indicate that this object (and its associated children) is no longer in use and that the implementation may relinquish any resources associated with it and its associated children.
<p>
Access to a released object will lead to unexpected result. </td>
</tr>
</table>
<aclass="anchor"name="e369b3e0ef4e277b26577c3854cd74fe"></a><!-- doxytag: member="XPath2Result::snapshotItem" ref="e369b3e0ef4e277b26577c3854cd74fe" args="(unsigned long index)=0" --><p>
Sets the current result to the indexth item in the snapshot collection.
<p>
If index is greater than or equal to the number of items in the list, this method returns false. Unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated. <dlcompact><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>index</em> </td><td>of type unsigned long - Index into the snapshot collection. </td></tr>
</table>
</dl>
<dlcompact><dt><b>Returns:</b></dt><dd>boolean True if the current result is the next item from the sequence or false if there are no more items. </dd></dl>
<dlcompact><dt><b>Exceptions:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>XPathException</em> </td><td>TYPE_ERR: raised if resultType is not SNAPSHOT_RESULT. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>