<!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:36 GMT 2011 --> <TITLE> XPathExpression </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="XPathExpression"; } } </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/sxpath/XPathEvaluator.html" title="class in net.sf.saxon.sxpath"><B>PREV CLASS</B></A> <A HREF="../../../../net/sf/saxon/sxpath/XPathStaticContext.html" title="interface in net.sf.saxon.sxpath"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/saxon/sxpath/XPathExpression.html" target="_top"><B>FRAMES</B></A> <A HREF="XPathExpression.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.sxpath</FONT> <BR> Class XPathExpression</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.sxpath.XPathExpression</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>XPathExpression</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/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DL> </PRE> <P> This class is a representation of an XPath Expression for use with the <A HREF="../../../../net/sf/saxon/sxpath/XPathEvaluator.html" title="class in net.sf.saxon.sxpath"><CODE>XPathEvaluator</CODE></A> class. It is modelled on the XPath API defined in JAXP 1.3, but is cut down to remove any dependencies on JAXP 1.3, making it suitable for use on vanilla JDK 1.4 installations. <P> <P> <DL> <DT><B>Author:</B></DT> <DD>Michael H. Kay</DD> <DT><B>See Also:</B><DD><A HREF="../../../../serialized-form.html#net.sf.saxon.sxpath.XPathExpression">Serialized Form</A></DL> <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/sxpath/XPathExpression.html#XPathExpression(net.sf.saxon.sxpath.XPathEvaluator, net.sf.saxon.expr.Expression)">XPathExpression</A></B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathEvaluator.html" title="class in net.sf.saxon.sxpath">XPathEvaluator</A> evaluator, <A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> exp)</CODE> <BR> The constructor is protected, to ensure that instances can only be created using the createExpression() method of XPathEvaluator</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> <A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#createDynamicContext()">createDynamicContext</A></B>()</CODE> <BR> Create a dynamic context suitable for evaluating this expression, without supplying a context item</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#createDynamicContext(net.sf.saxon.Controller, net.sf.saxon.om.Item)">createDynamicContext</A></B>(<A HREF="../../../../net/sf/saxon/Controller.html" title="class in net.sf.saxon">Controller</A> controller, <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A> contextItem)</CODE> <BR> Create a dynamic context suitable for evaluating this expression within an environment represented by an existing controller.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#createDynamicContext(net.sf.saxon.om.Item)">createDynamicContext</A></B>(<A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A> contextItem)</CODE> <BR> Create a dynamic context suitable for evaluating this expression</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="../../../../net/sf/saxon/sxpath/XPathExpression.html#effectiveBooleanValue(net.sf.saxon.sxpath.XPathDynamicContext)">effectiveBooleanValue</A></B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> context)</CODE> <BR> Evaluate the expression, returning its effective boolean value</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/List.html?is-external=true" title="class or interface in java.util">List</A><<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>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#evaluate(javax.xml.transform.Source)">evaluate</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Source.html?is-external=true" title="class or interface in javax.xml.transform">Source</A> source)</CODE> <BR> Execute a prepared XPath expression, returning the results as a List in which items have been converted to the appropriate Java object.</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/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#evaluate(net.sf.saxon.sxpath.XPathDynamicContext)">evaluate</A></B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> context)</CODE> <BR> Execute the expression, returning the result as a List, whose members will be instances of the class <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om"><CODE>Item</CODE></A></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/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#evaluateSingle(javax.xml.transform.Source)">evaluateSingle</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Source.html?is-external=true" title="class or interface in javax.xml.transform">Source</A> source)</CODE> <BR> Execute a prepared XPath expression, returning the first item in 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/om/Item.html" title="interface in net.sf.saxon.om">Item</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#evaluateSingle(net.sf.saxon.sxpath.XPathDynamicContext)">evaluateSingle</A></B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> context)</CODE> <BR> Execute the expression, returning the result as a single <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om"><CODE>Item</CODE></A> If the result of the expression is a sequence containing more than one item, items after the first are discarded.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#getInternalExpression()">getInternalExpression</A></B>()</CODE> <BR> Low-level method to get the internal Saxon expression object.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A><? extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#iterate(net.sf.saxon.sxpath.XPathDynamicContext)">iterate</A></B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> context)</CODE> <BR> Execute the expression, returning the result as a <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om"><CODE>SequenceIterator</CODE></A>, whose members will be instances of the class <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om"><CODE>Item</CODE></A></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#rawIterator(javax.xml.transform.Source)">rawIterator</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Source.html?is-external=true" title="class or interface in javax.xml.transform">Source</A> source)</CODE> <BR> <B>Deprecated.</B> <I>since 8.9 - use <A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#iterate(net.sf.saxon.sxpath.XPathDynamicContext)"><CODE>iterate(net.sf.saxon.sxpath.XPathDynamicContext)</CODE></A></I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#setStackFrameMap(net.sf.saxon.expr.instruct.SlotManager, int)">setStackFrameMap</A></B>(<A HREF="../../../../net/sf/saxon/expr/instruct/SlotManager.html" title="class in net.sf.saxon.expr.instruct">SlotManager</A> map, int numberOfExternalVariables)</CODE> <BR> Define the number of slots needed for local variables within the expression</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="XPathExpression(net.sf.saxon.sxpath.XPathEvaluator, net.sf.saxon.expr.Expression)"><!-- --></A><H3> XPathExpression</H3> <PRE> protected <B>XPathExpression</B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathEvaluator.html" title="class in net.sf.saxon.sxpath">XPathEvaluator</A> evaluator, <A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> exp)</PRE> <DL> <DD>The constructor is protected, to ensure that instances can only be created using the createExpression() method of XPathEvaluator <P> <DL> <DT><B>Parameters:</B><DD><CODE>evaluator</CODE> - the creating XPathEvaluator<DD><CODE>exp</CODE> - the internal representation of the compiled expression</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="setStackFrameMap(net.sf.saxon.expr.instruct.SlotManager, int)"><!-- --></A><H3> setStackFrameMap</H3> <PRE> protected void <B>setStackFrameMap</B>(<A HREF="../../../../net/sf/saxon/expr/instruct/SlotManager.html" title="class in net.sf.saxon.expr.instruct">SlotManager</A> map, int numberOfExternalVariables)</PRE> <DL> <DD>Define the number of slots needed for local variables within the expression <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>map</CODE> - the stack frame map identifying all the variables used by the expression, both those declared internally, and references to variables declared externally<DD><CODE>numberOfExternalVariables</CODE> - the number of slots in the stack frame allocated to externally-declared variables. These must be assigned a value before execution starts</DL> </DD> </DL> <HR> <A NAME="createDynamicContext()"><!-- --></A><H3> createDynamicContext</H3> <PRE> public <A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> <B>createDynamicContext</B>()</PRE> <DL> <DD>Create a dynamic context suitable for evaluating this expression, without supplying a context item <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>an XPathDynamicContext object representing a suitable dynamic context. This will be initialized with a stack frame suitable for holding the variables used by the expression.</DL> </DD> </DL> <HR> <A NAME="createDynamicContext(net.sf.saxon.om.Item)"><!-- --></A><H3> createDynamicContext</H3> <PRE> public <A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> <B>createDynamicContext</B>(<A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A> contextItem) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Create a dynamic context suitable for evaluating this expression <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>contextItem</CODE> - the initial context item, which may be null if no context item is required, or if it is to be supplied later <DT><B>Returns:</B><DD>an XPathDynamicContext object representing a suitable dynamic context. This will be initialized with a stack frame suitable for holding the variables used by the expression. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if the context item does not match the required context item type set up in the static context</DL> </DD> </DL> <HR> <A NAME="createDynamicContext(net.sf.saxon.Controller, net.sf.saxon.om.Item)"><!-- --></A><H3> createDynamicContext</H3> <PRE> public <A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> <B>createDynamicContext</B>(<A HREF="../../../../net/sf/saxon/Controller.html" title="class in net.sf.saxon">Controller</A> controller, <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A> contextItem) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Create a dynamic context suitable for evaluating this expression within an environment represented by an existing controller. The dynamic context will inherit properties of the Controller such as the current error listener, URI resolver, document pool, and implicit timezone. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>controller</CODE> - an existing controller. May be null, in which case the method is equivalent to calling <A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#createDynamicContext(net.sf.saxon.om.Item)"><CODE>createDynamicContext(net.sf.saxon.om.Item)</CODE></A><DD><CODE>contextItem</CODE> - the initial context item, which may be null if no context item is required, or if it is to be supplied later <DT><B>Returns:</B><DD>an XPathDynamicContext object representing a suitable dynamic context. This will be initialized with a stack frame suitable for holding the variables used by the expression. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if the context item does not match the required context item type set up in the static context<DT><B>Since:</B></DT> <DD>9.2</DD> </DL> </DD> </DL> <HR> <A NAME="iterate(net.sf.saxon.sxpath.XPathDynamicContext)"><!-- --></A><H3> iterate</H3> <PRE> public <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A><? extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>> <B>iterate</B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> context) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Execute the expression, returning the result as a <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om"><CODE>SequenceIterator</CODE></A>, whose members will be instances of the class <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om"><CODE>Item</CODE></A> <p>Note that if evaluation of the expression fails with a dynamic error, this will generally be reported in the form of an exception thrown by the next() method of the <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om"><CODE>SequenceIterator</CODE></A> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>context</CODE> - the XPath dynamic context <DT><B>Returns:</B><DD>an iterator over the result of the expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs during the expression evaluation (though in many cases, the error will only be detected when the iterator is actually used).</DL> </DD> </DL> <HR> <A NAME="evaluate(net.sf.saxon.sxpath.XPathDynamicContext)"><!-- --></A><H3> evaluate</H3> <PRE> public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>> <B>evaluate</B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> context) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Execute the expression, returning the result as a List, whose members will be instances of the class <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om"><CODE>Item</CODE></A> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>context</CODE> - the XPath dynamic context <DT><B>Returns:</B><DD>a list of items representing the result of the expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs while evaluation the expression</DL> </DD> </DL> <HR> <A NAME="evaluateSingle(net.sf.saxon.sxpath.XPathDynamicContext)"><!-- --></A><H3> evaluateSingle</H3> <PRE> public <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A> <B>evaluateSingle</B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> context) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Execute the expression, returning the result as a single <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om"><CODE>Item</CODE></A> If the result of the expression is a sequence containing more than one item, items after the first are discarded. If the result is an empty sequence, the method returns null. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>context</CODE> - the XPath dynamic context <DT><B>Returns:</B><DD>the first item in the result of the expression, or null to indicate that the result is an empty sequence <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs during the expression evaluation</DL> </DD> </DL> <HR> <A NAME="effectiveBooleanValue(net.sf.saxon.sxpath.XPathDynamicContext)"><!-- --></A><H3> effectiveBooleanValue</H3> <PRE> public boolean <B>effectiveBooleanValue</B>(<A HREF="../../../../net/sf/saxon/sxpath/XPathDynamicContext.html" title="class in net.sf.saxon.sxpath">XPathDynamicContext</A> context) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Evaluate the expression, returning its effective boolean value <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>context</CODE> - the XPath dynamic context <DT><B>Returns:</B><DD>the effective boolean value of the result, as defined by the fn:boolean() function <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs, or if the result is a value for which no effective boolean value is defined</DL> </DD> </DL> <HR> <A NAME="evaluate(javax.xml.transform.Source)"><!-- --></A><H3> evaluate</H3> <PRE> public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<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>evaluate</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Source.html?is-external=true" title="class or interface in javax.xml.transform">Source</A> source) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Execute a prepared XPath expression, returning the results as a List in which items have been converted to the appropriate Java object. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>source</CODE> - the document or other node against which the XPath expression will be evaluated. This may be a Saxon NodeInfo object, representing a node in an existing tree, or it may be any kind of JAXP Source object such as a StreamSource SAXSource or DOMSource. For the way in which the source document is built, see <A HREF="../../../../net/sf/saxon/Configuration.html#buildDocument(javax.xml.transform.Source)"><CODE>Configuration.buildDocument(javax.xml.transform.Source)</CODE></A> <DT><B>Returns:</B><DD>The results of the expression, as a List. The List represents the sequence of items returned by the expression. Each item in the list will either be an instance of net.sf.saxon.om.NodeInfo, representing a node, or a Java object representing an atomic value. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs during the expression evaluation</DL> </DD> </DL> <HR> <A NAME="evaluateSingle(javax.xml.transform.Source)"><!-- --></A><H3> evaluateSingle</H3> <PRE> public <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>evaluateSingle</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Source.html?is-external=true" title="class or interface in javax.xml.transform">Source</A> source) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Execute a prepared XPath expression, returning the first item in the result. This is useful where it is known that the expression will only return a singleton value (for example, a single node, or a boolean). <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>source</CODE> - the document or other node against which the XPath expression will be evaluated. This may be a Saxon NodeInfo object, representing a node in an existing tree, or it may be any kind of JAXP Source object such as a StreamSource SAXSource or DOMSource. For the way in which the source document is built, see <A HREF="../../../../net/sf/saxon/Configuration.html#buildDocument(javax.xml.transform.Source)"><CODE>Configuration.buildDocument(javax.xml.transform.Source)</CODE></A> <DT><B>Returns:</B><DD>The first item in the sequence returned by the expression. If the expression returns an empty sequence, this method returns null. Otherwise, it returns the first item in the result sequence, represented as a Java object using the same mapping as for the evaluate() method <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs during the expression evaluation</DL> </DD> </DL> <HR> <A NAME="rawIterator(javax.xml.transform.Source)"><!-- --></A><H3> rawIterator</H3> <PRE> public <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A> <B>rawIterator</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Source.html?is-external=true" title="class or interface in javax.xml.transform">Source</A> source) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD><B>Deprecated.</B> <I>since 8.9 - use <A HREF="../../../../net/sf/saxon/sxpath/XPathExpression.html#iterate(net.sf.saxon.sxpath.XPathDynamicContext)"><CODE>iterate(net.sf.saxon.sxpath.XPathDynamicContext)</CODE></A></I> <P> <DD>Get a raw iterator over the results of the expression. This returns results without any conversion of the returned items to "native" Java classes. This method is intended for use by applications that need to process the results of the expression using internal Saxon interfaces. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>source</CODE> - the document or other node against which the XPath expression will be evaluated. This may be a Saxon NodeInfo object, representing a node in an existing tree, or it may be any kind of JAXP Source object such as a StreamSource SAXSource or DOMSource. For the way in which the source document is built, see <A HREF="../../../../net/sf/saxon/Configuration.html#buildDocument(javax.xml.transform.Source)"><CODE>Configuration.buildDocument(javax.xml.transform.Source)</CODE></A> <DT><B>Returns:</B><DD>an iterator over the results of the expression <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs during the expression evaluation</DL> </DD> </DL> <HR> <A NAME="getInternalExpression()"><!-- --></A><H3> getInternalExpression</H3> <PRE> public <A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> <B>getInternalExpression</B>()</PRE> <DL> <DD>Low-level method to get the internal Saxon expression object. This exposes a wide range of internal methods that may be needed by specialized applications, and allows greater control over the dynamic context for evaluating the expression. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the underlying Saxon expression object.</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/sxpath/XPathEvaluator.html" title="class in net.sf.saxon.sxpath"><B>PREV CLASS</B></A> <A HREF="../../../../net/sf/saxon/sxpath/XPathStaticContext.html" title="interface in net.sf.saxon.sxpath"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/saxon/sxpath/XPathExpression.html" target="_top"><B>FRAMES</B></A> <A HREF="XPathExpression.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>