<!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 Fri Dec 09 20:48:27 GMT 2011 --> <TITLE> XPathSelector </TITLE> <META NAME="date" CONTENT="2011-12-09"> <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="XPathSelector"; } } </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="../../../../net/sf/saxon/s9api/XPathExecutable.html" title="class in net.sf.saxon.s9api"><B>PREV CLASS</B></A> <A HREF="../../../../net/sf/saxon/s9api/XQueryCompiler.html" title="class in net.sf.saxon.s9api"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/saxon/s9api/XPathSelector.html" target="_top"><B>FRAMES</B></A> <A HREF="XPathSelector.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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"> net.sf.saxon.s9api</FONT> <BR> Class XPathSelector</H2> <PRE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>net.sf.saxon.s9api.XPathSelector</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><<A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A>></DD> </DL> <HR> <DL> <DT><PRE>public class <B>XPathSelector</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><<A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A>></DL> </PRE> <P> An XPathSelector represents a compiled and loaded XPath expression ready for execution. The XPathSelector holds details of the dynamic evaluation context for the XPath expression. <P> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_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>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#XPathSelector(net.sf.saxon.sxpath.XPathExpression, java.util.ArrayList)">XPathSelector</A></B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html" title="class in net.sf.saxon.sxpath">XPathExpression</A> exp, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A><<A HREF="../../../../net/sf/saxon/sxpath/XPathVariable.html" title="class in net.sf.saxon.sxpath">XPathVariable</A>> declaredVariables)</CODE> <BR> </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="../../../../net/sf/saxon/s9api/XPathSelector.html#effectiveBooleanValue()">effectiveBooleanValue</A></B>()</CODE> <BR> Evaluate the XPath expression, returning the effective boolean value of the result.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/s9api/XdmValue.html" title="class in net.sf.saxon.s9api">XdmValue</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#evaluate()">evaluate</A></B>()</CODE> <BR> Evaluate the expression, returning the result as an <code>XdmValue</code> (that is, a sequence of nodes and/or atomic values).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#evaluateSingle()">evaluateSingle</A></B>()</CODE> <BR> Evaluate the XPath expression, returning the result as an <code>XdmItem</code> (that is, a single node or atomic value).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#getContextItem()">getContextItem</A></B>()</CODE> <BR> Get the context item used for evaluating the XPath expression.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/URIResolver.html?is-external=true" title="class or interface in javax.xml.transform">URIResolver</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#getURIResolver()">getURIResolver</A></B>()</CODE> <BR> Get the URI resolver.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A><<A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#iterator()">iterator</A></B>()</CODE> <BR> Evaluate the expression, returning the result as an <code>Iterator</code> (that is, an iterator over a sequence of nodes and/or atomic values).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#setContextItem(net.sf.saxon.s9api.XdmItem)">setContextItem</A></B>(<A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A> item)</CODE> <BR> Set the context item for evaluating the XPath expression.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#setURIResolver(javax.xml.transform.URIResolver)">setURIResolver</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/URIResolver.html?is-external=true" title="class or interface in javax.xml.transform">URIResolver</A> resolver)</CODE> <BR> Set an object that will be used to resolve URIs used in fn:doc() and related functions.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/s9api/XPathSelector.html#setVariable(net.sf.saxon.s9api.QName, net.sf.saxon.s9api.XdmValue)">setVariable</A></B>(<A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A> name, <A HREF="../../../../net/sf/saxon/s9api/XdmValue.html" title="class in net.sf.saxon.s9api">XdmValue</A> value)</CODE> <BR> Set the value of a variable</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_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>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="XPathSelector(net.sf.saxon.sxpath.XPathExpression, java.util.ArrayList)"><!-- --></A><H3> XPathSelector</H3> <PRE> protected <B>XPathSelector</B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html" title="class in net.sf.saxon.sxpath">XPathExpression</A> exp, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</A><<A HREF="../../../../net/sf/saxon/sxpath/XPathVariable.html" title="class in net.sf.saxon.sxpath">XPathVariable</A>> declaredVariables)</PRE> <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="setContextItem(net.sf.saxon.s9api.XdmItem)"><!-- --></A><H3> setContextItem</H3> <PRE> public void <B>setContextItem</B>(<A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A> item) throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD>Set the context item for evaluating the XPath expression. This may be either a node or an atomic value. Most commonly it will be a document node, which might be constructed using the <A HREF="../../../../net/sf/saxon/s9api/DocumentBuilder.html#build(javax.xml.transform.Source)"><CODE>DocumentBuilder.build(javax.xml.transform.Source)</CODE></A> method. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>item</CODE> - The context item for evaluating the expression. Must not be null. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if an error occurs, for example because the type of item supplied does not match the required item type</DL> </DD> </DL> <HR> <A NAME="getContextItem()"><!-- --></A><H3> getContextItem</H3> <PRE> public <A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A> <B>getContextItem</B>()</PRE> <DL> <DD>Get the context item used for evaluating the XPath expression. This may be either a node or an atomic value. Most commonly it will be a document node, which might be constructed using the Build method of the DocumentBuilder object. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The context item for evaluating the expression, or null if no context item has been set.</DL> </DD> </DL> <HR> <A NAME="setVariable(net.sf.saxon.s9api.QName, net.sf.saxon.s9api.XdmValue)"><!-- --></A><H3> setVariable</H3> <PRE> public void <B>setVariable</B>(<A HREF="../../../../net/sf/saxon/s9api/QName.html" title="class in net.sf.saxon.s9api">QName</A> name, <A HREF="../../../../net/sf/saxon/s9api/XdmValue.html" title="class in net.sf.saxon.s9api">XdmValue</A> value) throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD>Set the value of a variable <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - The name of the variable. This must match the name of a variable that was declared to the XPathCompiler. No error occurs if the expression does not actually reference a variable with this name.<DD><CODE>value</CODE> - The value to be given to the variable. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if the variable has not been declared or if the type of the value supplied does not conform to the required type that was specified when the variable was declared</DL> </DD> </DL> <HR> <A NAME="setURIResolver(javax.xml.transform.URIResolver)"><!-- --></A><H3> setURIResolver</H3> <PRE> public void <B>setURIResolver</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/URIResolver.html?is-external=true" title="class or interface in javax.xml.transform">URIResolver</A> resolver)</PRE> <DL> <DD>Set an object that will be used to resolve URIs used in fn:doc() and related functions. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>resolver</CODE> - An object that implements the URIResolver interface, or null.<DT><B>Since:</B></DT> <DD>9.4</DD> </DL> </DD> </DL> <HR> <A NAME="getURIResolver()"><!-- --></A><H3> getURIResolver</H3> <PRE> public <A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/URIResolver.html?is-external=true" title="class or interface in javax.xml.transform">URIResolver</A> <B>getURIResolver</B>()</PRE> <DL> <DD>Get the URI resolver. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the user-supplied URI resolver if there is one, or the system-defined one otherwise<DT><B>Since:</B></DT> <DD>9.4</DD> </DL> </DD> </DL> <HR> <A NAME="evaluate()"><!-- --></A><H3> evaluate</H3> <PRE> public <A HREF="../../../../net/sf/saxon/s9api/XdmValue.html" title="class in net.sf.saxon.s9api">XdmValue</A> <B>evaluate</B>() throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD>Evaluate the expression, returning the result as an <code>XdmValue</code> (that is, a sequence of nodes and/or atomic values). <p>Note: Although a singleton result <i>may</i> be represented as an <code>XdmItem</code>, there is no guarantee that this will always be the case. If you know that the expression will return at most one node or atomic value, it is best to use the <code>evaluateSingle</code> method, which does guarantee that an <code>XdmItem</code> (or null) will be returned.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>An <code>XdmValue</code> representing the results of the expression. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if a dynamic error occurs during the expression evaluation.</DL> </DD> </DL> <HR> <A NAME="evaluateSingle()"><!-- --></A><H3> evaluateSingle</H3> <PRE> public <A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A> <B>evaluateSingle</B>() throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD>Evaluate the XPath expression, returning the result as an <code>XdmItem</code> (that is, a single node or atomic value). <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>an <code>XdmItem</code> representing the result of the expression, or null if the expression returns an empty sequence. If the expression returns a sequence of more than one item, any items after the first are ignored. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if a dynamic error occurs during the expression evaluation.</DL> </DD> </DL> <HR> <A NAME="iterator()"><!-- --></A><H3> iterator</H3> <PRE> public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A><<A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A>> <B>iterator</B>() throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiUncheckedException.html" title="class in net.sf.saxon.s9api">SaxonApiUncheckedException</A></PRE> <DL> <DD>Evaluate the expression, returning the result as an <code>Iterator</code> (that is, an iterator over a sequence of nodes and/or atomic values). <p>Because an <code>XPathSelector</code> is an <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang"><CODE>Iterable</CODE></A>, it is possible to iterate over the result using a Java 5 "for each" expression, for example:</p> <p><pre> XPathCompiler compiler = processor.newXPathCompiler(); XPathSelector seq = compiler.compile("1 to 20").load(); for (XdmItem item : seq) { System.err.println(item); } </pre></p> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true#iterator()" title="class or interface in java.lang">iterator</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><<A HREF="../../../../net/sf/saxon/s9api/XdmItem.html" title="class in net.sf.saxon.s9api">XdmItem</A>></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>An iterator over the sequence that represents the results of the expression. Each object in this sequence will be an instance of <code>XdmItem</code>. Note that the expression may be evaluated lazily, which means that a successful response from this method does not imply that the expression has executed successfully: failures may be reported later while retrieving items from the iterator. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiUncheckedException.html" title="class in net.sf.saxon.s9api">SaxonApiUncheckedException</A></CODE> - if a dynamic error occurs during XPath evaluation that can be detected at this point. It is also possible that an SaxonApiUncheckedException will be thrown by the <code>hasNext()</code> method of the returned iterator.</DL> </DD> </DL> <HR> <A NAME="effectiveBooleanValue()"><!-- --></A><H3> effectiveBooleanValue</H3> <PRE> public boolean <B>effectiveBooleanValue</B>() throws <A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></PRE> <DL> <DD>Evaluate the XPath expression, returning the effective boolean value of the result. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>a <code>boolean</code> representing the effective boolean value of the result of evaluating the expression, as defined by the rules for the fn:boolean() function. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/s9api/SaxonApiException.html" title="class in net.sf.saxon.s9api">SaxonApiException</A></CODE> - if a dynamic error occurs during the expression evaluation, or if the result of the expression is a value whose effective boolean value is not defined (for example, a date or a sequence of three integers)<DT><B>Since:</B></DT> <DD>9.1</DD> </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="../../../../net/sf/saxon/s9api/XPathExecutable.html" title="class in net.sf.saxon.s9api"><B>PREV CLASS</B></A> <A HREF="../../../../net/sf/saxon/s9api/XQueryCompiler.html" title="class in net.sf.saxon.s9api"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/saxon/s9api/XPathSelector.html" target="_top"><B>FRAMES</B></A> <A HREF="XPathSelector.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 | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright (c) 2004-2011 Saxonica Limited. All rights reserved. </BODY> </HTML>