<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Sun Jun 12 19:55:32 JST 2011 --> <TITLE> XPathResult (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3) </TITLE> <META NAME="date" CONTENT="2011-06-12"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="XPathResult (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/w3c/dom/xpath/XPathNSResolver.html" title="interface in org.w3c.dom.xpath"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/w3c/dom/xpath/XPathResult.html" target="_top"><B>FRAMES</B></A> <A HREF="XPathResult.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.w3c.dom.xpath</FONT> <BR> Interface XPathResult</H2> <HR> <DL> <DT><PRE>public interface <B>XPathResult</B></DL> </PRE> <P> The <code>XPathResult</code> interface represents the result of the evaluation of an XPath 1.0 expression within the context of a particular node. Since evaluation of an XPath expression can result in various result types, this object makes it possible to discover and manipulate the type and value of the result. <p>See also the <a href='http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226'>Document Object Model (DOM) Level 3 XPath Specification</a>. <P> <P> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#ANY_TYPE">ANY_TYPE</A></B></CODE> <BR> This code does not represent a specific type.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#ANY_UNORDERED_NODE_TYPE">ANY_UNORDERED_NODE_TYPE</A></B></CODE> <BR> The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] and will be accessed as a single node, which may be <code>null</code>if the node set is empty.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#BOOLEAN_TYPE">BOOLEAN_TYPE</A></B></CODE> <BR> The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#booleans'>boolean</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>].</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#FIRST_ORDERED_NODE_TYPE">FIRST_ORDERED_NODE_TYPE</A></B></CODE> <BR> The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] and will be accessed as a single node, which may be <code>null</code> if the node set is empty.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#NUMBER_TYPE">NUMBER_TYPE</A></B></CODE> <BR> The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#numbers'>number</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>].</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#ORDERED_NODE_ITERATOR_TYPE">ORDERED_NODE_ITERATOR_TYPE</A></B></CODE> <BR> The result is a node set as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that will be accessed iteratively, which will produce document-ordered nodes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#ORDERED_NODE_SNAPSHOT_TYPE">ORDERED_NODE_SNAPSHOT_TYPE</A></B></CODE> <BR> The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that will be accessed as a snapshot list of nodes that will be in original document order.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#STRING_TYPE">STRING_TYPE</A></B></CODE> <BR> The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#strings'>string</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>].</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#UNORDERED_NODE_ITERATOR_TYPE">UNORDERED_NODE_ITERATOR_TYPE</A></B></CODE> <BR> The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that will be accessed iteratively, which may not produce nodes in a particular order.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#UNORDERED_NODE_SNAPSHOT_TYPE">UNORDERED_NODE_SNAPSHOT_TYPE</A></B></CODE> <BR> The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that will be accessed as a snapshot list of nodes that may not be in a particular order.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#getBooleanValue()">getBooleanValue</A></B>()</CODE> <BR> The value of this boolean result.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#getInvalidIteratorState()">getInvalidIteratorState</A></B>()</CODE> <BR> Signifies that the iterator has become invalid.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#getNumberValue()">getNumberValue</A></B>()</CODE> <BR> The value of this number result.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> short</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#getResultType()">getResultType</A></B>()</CODE> <BR> A code representing the type of this result, as defined by the type constants.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#getSingleNodeValue()">getSingleNodeValue</A></B>()</CODE> <BR> The value of this single node result, which may be <code>null</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#getSnapshotLength()">getSnapshotLength</A></B>()</CODE> <BR> The number of nodes in the result snapshot.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#getStringValue()">getStringValue</A></B>()</CODE> <BR> The value of this string result.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#iterateNext()">iterateNext</A></B>()</CODE> <BR> Iterates and returns the next node from the node set or <code>null</code>if there are no more nodes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/xpath/XPathResult.html#snapshotItem(int)">snapshotItem</A></B>(int index)</CODE> <BR> Returns the <code>index</code>th item in the snapshot collection.</TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="ANY_TYPE"><!-- --></A><H3> ANY_TYPE</H3> <PRE> static final short <B>ANY_TYPE</B></PRE> <DL> <DD>This code does not represent a specific type. An evaluation of an XPath expression will never produce this type. If this type is requested, then the evaluation returns whatever type naturally results from evaluation of the expression. <br>If the natural result is a node set when <code>ANY_TYPE</code> was requested, then <code>UNORDERED_NODE_ITERATOR_TYPE</code> is always the resulting type. Any other representation of a node set must be explicitly requested. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.ANY_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="NUMBER_TYPE"><!-- --></A><H3> NUMBER_TYPE</H3> <PRE> static final short <B>NUMBER_TYPE</B></PRE> <DL> <DD>The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#numbers'>number</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>]. Document modification does not invalidate the number, but may mean that reevaluation would not yield the same number. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.NUMBER_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="STRING_TYPE"><!-- --></A><H3> STRING_TYPE</H3> <PRE> static final short <B>STRING_TYPE</B></PRE> <DL> <DD>The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#strings'>string</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>]. Document modification does not invalidate the string, but may mean that the string no longer corresponds to the current document. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.STRING_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="BOOLEAN_TYPE"><!-- --></A><H3> BOOLEAN_TYPE</H3> <PRE> static final short <B>BOOLEAN_TYPE</B></PRE> <DL> <DD>The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#booleans'>boolean</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>]. Document modification does not invalidate the boolean, but may mean that reevaluation would not yield the same boolean. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.BOOLEAN_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="UNORDERED_NODE_ITERATOR_TYPE"><!-- --></A><H3> UNORDERED_NODE_ITERATOR_TYPE</H3> <PRE> static final short <B>UNORDERED_NODE_ITERATOR_TYPE</B></PRE> <DL> <DD>The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that will be accessed iteratively, which may not produce nodes in a particular order. Document modification invalidates the iteration. <br>This is the default type returned if the result is a node set and <code>ANY_TYPE</code> is requested. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.UNORDERED_NODE_ITERATOR_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="ORDERED_NODE_ITERATOR_TYPE"><!-- --></A><H3> ORDERED_NODE_ITERATOR_TYPE</H3> <PRE> static final short <B>ORDERED_NODE_ITERATOR_TYPE</B></PRE> <DL> <DD>The result is a node set as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that will be accessed iteratively, which will produce document-ordered nodes. Document modification invalidates the iteration. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.ORDERED_NODE_ITERATOR_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="UNORDERED_NODE_SNAPSHOT_TYPE"><!-- --></A><H3> UNORDERED_NODE_SNAPSHOT_TYPE</H3> <PRE> static final short <B>UNORDERED_NODE_SNAPSHOT_TYPE</B></PRE> <DL> <DD>The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that will be accessed as a snapshot list of nodes that may not be in a particular order. Document modification does not invalidate the snapshot but may mean that reevaluation would not yield the same snapshot and nodes in the snapshot may have been altered, moved, or removed from the document. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="ORDERED_NODE_SNAPSHOT_TYPE"><!-- --></A><H3> ORDERED_NODE_SNAPSHOT_TYPE</H3> <PRE> static final short <B>ORDERED_NODE_SNAPSHOT_TYPE</B></PRE> <DL> <DD>The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] that will be accessed as a snapshot list of nodes that will be in original document order. Document modification does not invalidate the snapshot but may mean that reevaluation would not yield the same snapshot and nodes in the snapshot may have been altered, moved, or removed from the document. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="ANY_UNORDERED_NODE_TYPE"><!-- --></A><H3> ANY_UNORDERED_NODE_TYPE</H3> <PRE> static final short <B>ANY_UNORDERED_NODE_TYPE</B></PRE> <DL> <DD>The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] and will be accessed as a single node, which may be <code>null</code>if the node set is empty. Document modification does not invalidate the node, but may mean that the result node no longer corresponds to the current document. This is a convenience that permits optimization since the implementation can stop once any node in the resulting set has been found. <br>If there is more than one node in the actual result, the single node returned might not be the first in document order. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.ANY_UNORDERED_NODE_TYPE">Constant Field Values</A></DL> </DL> <HR> <A NAME="FIRST_ORDERED_NODE_TYPE"><!-- --></A><H3> FIRST_ORDERED_NODE_TYPE</H3> <PRE> static final short <B>FIRST_ORDERED_NODE_TYPE</B></PRE> <DL> <DD>The result is a <a href='http://www.w3.org/TR/1999/REC-xpath-19991116#node-sets'>node set</a> as defined by [<a href='http://www.w3.org/TR/1999/REC-xpath-19991116'>XPath 1.0</a>] and will be accessed as a single node, which may be <code>null</code> if the node set is empty. Document modification does not invalidate the node, but may mean that the result node no longer corresponds to the current document. This is a convenience that permits optimization since the implementation can stop once the first node in document order of the resulting set has been found. <br>If there are more than one node in the actual result, the single node returned will be the first in document order. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.w3c.dom.xpath.XPathResult.FIRST_ORDERED_NODE_TYPE">Constant Field Values</A></DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getResultType()"><!-- --></A><H3> getResultType</H3> <PRE> short <B>getResultType</B>()</PRE> <DL> <DD>A code representing the type of this result, as defined by the type constants. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getNumberValue()"><!-- --></A><H3> getNumberValue</H3> <PRE> double <B>getNumberValue</B>() throws <A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></PRE> <DL> <DD>The value of this number result. 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. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></CODE> - TYPE_ERR: raised if <code>resultType</code> is not <code>NUMBER_TYPE</code>.</DL> </DD> </DL> <HR> <A NAME="getStringValue()"><!-- --></A><H3> getStringValue</H3> <PRE> java.lang.String <B>getStringValue</B>() throws <A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></PRE> <DL> <DD>The value of this string result. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></CODE> - TYPE_ERR: raised if <code>resultType</code> is not <code>STRING_TYPE</code>.</DL> </DD> </DL> <HR> <A NAME="getBooleanValue()"><!-- --></A><H3> getBooleanValue</H3> <PRE> boolean <B>getBooleanValue</B>() throws <A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></PRE> <DL> <DD>The value of this boolean result. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></CODE> - TYPE_ERR: raised if <code>resultType</code> is not <code>BOOLEAN_TYPE</code>.</DL> </DD> </DL> <HR> <A NAME="getSingleNodeValue()"><!-- --></A><H3> getSingleNodeValue</H3> <PRE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A> <B>getSingleNodeValue</B>() throws <A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></PRE> <DL> <DD>The value of this single node result, which may be <code>null</code>. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></CODE> - TYPE_ERR: raised if <code>resultType</code> is not <code>ANY_UNORDERED_NODE_TYPE</code> or <code>FIRST_ORDERED_NODE_TYPE</code>.</DL> </DD> </DL> <HR> <A NAME="getInvalidIteratorState()"><!-- --></A><H3> getInvalidIteratorState</H3> <PRE> boolean <B>getInvalidIteratorState</B>()</PRE> <DL> <DD>Signifies that the iterator has become invalid. True if <code>resultType</code> is <code>UNORDERED_NODE_ITERATOR_TYPE</code> or <code>ORDERED_NODE_ITERATOR_TYPE</code> and the document has been modified since this result was returned. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getSnapshotLength()"><!-- --></A><H3> getSnapshotLength</H3> <PRE> int <B>getSnapshotLength</B>() throws <A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></PRE> <DL> <DD>The number of nodes in the result snapshot. Valid values for snapshotItem indices are <code>0</code> to <code>snapshotLength-1</code> inclusive. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></CODE> - TYPE_ERR: raised if <code>resultType</code> is not <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.</DL> </DD> </DL> <HR> <A NAME="iterateNext()"><!-- --></A><H3> iterateNext</H3> <PRE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A> <B>iterateNext</B>() throws <A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A>, <A HREF="../../../../org/w3c/dom/DOMException.html" title="class in org.w3c.dom">DOMException</A></PRE> <DL> <DD>Iterates and returns the next node from the node set or <code>null</code>if there are no more nodes. <P> <DD><DL> <DT><B>Returns:</B><DD>Returns the next node. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></CODE> - TYPE_ERR: raised if <code>resultType</code> is not <code>UNORDERED_NODE_ITERATOR_TYPE</code> or <code>ORDERED_NODE_ITERATOR_TYPE</code>. <DD><CODE><A HREF="../../../../org/w3c/dom/DOMException.html" title="class in org.w3c.dom">DOMException</A></CODE> - INVALID_STATE_ERR: The document has been mutated since the result was returned.</DL> </DD> </DL> <HR> <A NAME="snapshotItem(int)"><!-- --></A><H3> snapshotItem</H3> <PRE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A> <B>snapshotItem</B>(int index) throws <A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></PRE> <DL> <DD>Returns the <code>index</code>th item in the snapshot collection. If <code>index</code> is greater than or equal to the number of nodes in the list, this method returns <code>null</code>. Unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>index</CODE> - Index into the snapshot collection. <DT><B>Returns:</B><DD>The node at the <code>index</code>th position in the <code>NodeList</code>, or <code>null</code> if that is not a valid index. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/xpath/XPathException.html" title="class in org.w3c.dom.xpath">XPathException</A></CODE> - TYPE_ERR: raised if <code>resultType</code> is not <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/w3c/dom/xpath/XPathNSResolver.html" title="interface in org.w3c.dom.xpath"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/w3c/dom/xpath/XPathResult.html" target="_top"><B>FRAMES</B></A> <A HREF="XPathResult.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>