blob: 6a50e259b2fbcce3076ecfb07ccbc5f816b41ef0 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Nov 22 17:12:53 EST 2007 -->
<TITLE>
Xalan-Java 2.7.1: Interface XPathExpression
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XPathExpression.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/xml/xpath/XPath.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/xml/xpath/XPathFunction.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="XPathExpression.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.xml.xpath</FONT>
<BR>
Interface XPathExpression</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../org/apache/xpath/jaxp/XPathExpressionImpl.html">XPathExpressionImpl</A></DD>
</DL>
<HR>
<DL>
<DT>public interface <B>XPathExpression</B></DL>
<P>
<p><code>XPathExpression</code> provides access to compiled XPath expressions.</p>
<table id="XPathExpression-evaluation" border="1" cellpadding="2">
<thead>
<tr>
<th colspan="2">Evaluation of XPath Expressions.</th>
</tr>
</thead>
<tbody>
<tr>
<td>context</td>
<td>
If a request is made to evaluate the expression in the absence
of a context item, an empty document node will be used for the context.
For the purposes of evaluating XPath expressions, a DocumentFragment
is treated like a Document node.
</td>
</tr>
<tr>
<td>variables</td>
<td>
If the expression contains a variable reference, its value will be found through the <A HREF="../../../javax/xml/xpath/XPathVariableResolver.html"><CODE>XPathVariableResolver</CODE></A>.
An <A HREF="../../../javax/xml/xpath/XPathExpressionException.html"><CODE>XPathExpressionException</CODE></A> is raised if the variable resolver is undefined or
the resolver returns <code>null</code> for the variable.
The value of a variable must be immutable through the course of any single evaluation.</p>
</td>
</tr>
<tr>
<td>functions</td>
<td>
If the expression contains a function reference, the function will be found through the <A HREF="../../../javax/xml/xpath/XPathFunctionResolver.html"><CODE>XPathFunctionResolver</CODE></A>.
An <A HREF="../../../javax/xml/xpath/XPathExpressionException.html"><CODE>XPathExpressionException</CODE></A> is raised if the function resolver is undefined or
the function resolver returns <code>null</code> for the function.</p>
</td>
</tr>
<tr>
<td>QNames</td>
<td>
QNames in the expression are resolved against the XPath namespace context.
</td>
</tr>
<tr>
<td>result</td>
<td>
This result of evaluating an expression is converted to an instance of the desired return type.
Valid return types are defined in <A HREF="../../../javax/xml/xpath/XPathConstants.html"><CODE>XPathConstants</CODE></A>.
Conversion to the return type follows XPath conversion rules.</p>
</td>
</tr>
</table>
<P>
<DL>
<DT><B>Since: </B><DD>1.5</DD>
<DT><B>See Also: </B><DD><a href="http://www.w3.org/TR/xpath#section-Expressions">XML Path Language (XPath) Version 1.0, Expressions</a></DL>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xpath/XPathExpression.html#evaluate(org.xml.sax.InputSource)">evaluate</A></B>(<A HREF="../../../org/xml/sax/InputSource.html">InputSource</A>&nbsp;source)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluate the compiled XPath expression in the context of the specified <code>InputSource</code> and return the result as a
<code>String</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xpath/XPathExpression.html#evaluate(org.xml.sax.InputSource, javax.xml.namespace.QName)">evaluate</A></B>(<A HREF="../../../org/xml/sax/InputSource.html">InputSource</A>&nbsp;source,
<A HREF="../../../javax/xml/namespace/QName.html">QName</A>&nbsp;returnType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluate the compiled XPath expression in the context of the specified <code>InputSource</code> and return the result as the
specified type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xpath/XPathExpression.html#evaluate(java.lang.Object)">evaluate</A></B>(java.lang.Object&nbsp;item)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluate the compiled XPath expression in the specified context and return the result as a <code>String</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xpath/XPathExpression.html#evaluate(java.lang.Object, javax.xml.namespace.QName)">evaluate</A></B>(java.lang.Object&nbsp;item,
<A HREF="../../../javax/xml/namespace/QName.html">QName</A>&nbsp;returnType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluate the compiled XPath expression in the specified context and return the result as the specified type.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="evaluate(java.lang.Object, javax.xml.namespace.QName)"><!-- --></A><H3>
evaluate</H3>
<PRE>
public java.lang.Object <B>evaluate</B>(java.lang.Object&nbsp;item,
<A HREF="../../../javax/xml/namespace/QName.html">QName</A>&nbsp;returnType)
throws <A HREF="../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
<DL>
<DD><p>Evaluate the compiled XPath expression in the specified context and return the result as the specified type.</p>
<p>See <a href="#XPathExpression-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
variable, function and QName resolution and return type conversion.</p>
<p>If <code>returnType</code> is not one of the types defined in <A HREF="../../../javax/xml/xpath/XPathConstants.html"><CODE>XPathConstants</CODE></A>,
then an <code>IllegalArgumentException</code> is thrown.</p>
<p>If a <code>null</code> value is provided for
<code>item</code>, an empty document will be used for the
context.
If <code>returnType</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>item</CODE> - The starting context (node or node list, for example).<DD><CODE>returnType</CODE> - The desired return type.<DT><B>Returns:</B><DD>The <code>Object</code> that is the result of evaluating the expression and converting the result to
<code>returnType</code>.<DT><B>Throws:</B><DD><A HREF="../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A> - If the expression cannot be evaluated.<DD>java.lang.IllegalArgumentException - If <code>returnType</code> is not one of the types defined in <A HREF="../../../javax/xml/xpath/XPathConstants.html"><CODE>XPathConstants</CODE></A>.<DD>java.lang.NullPointerException - If <code>returnType</code> is <code>null</code>.</DL>
</DD>
</DL>
<HR>
<A NAME="evaluate(java.lang.Object)"><!-- --></A><H3>
evaluate</H3>
<PRE>
public java.lang.String <B>evaluate</B>(java.lang.Object&nbsp;item)
throws <A HREF="../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
<DL>
<DD><p>Evaluate the compiled XPath expression in the specified context and return the result as a <code>String</code>.</p>
<p>This method calls <A HREF="../../../javax/xml/xpath/XPathExpression.html#evaluate(java.lang.Object, javax.xml.namespace.QName)"><CODE>evaluate(Object item, QName returnType)</CODE></A> with a <code>returnType</code> of
<A HREF="../../../javax/xml/xpath/XPathConstants.html#STRING"><CODE>XPathConstants.STRING</CODE></A>.</p>
<p>See <a href="#XPathExpression-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
variable, function and QName resolution and return type conversion.</p>
<p>If a <code>null</code> value is provided for
<code>item</code>, an empty document will be used for the
context.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>item</CODE> - The starting context (node or node list, for example).<DT><B>Returns:</B><DD>The <code>String</code> that is the result of evaluating the expression and converting the result to a
<code>String</code>.<DT><B>Throws:</B><DD><A HREF="../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A> - If the expression cannot be evaluated.</DL>
</DD>
</DL>
<HR>
<A NAME="evaluate(org.xml.sax.InputSource, javax.xml.namespace.QName)"><!-- --></A><H3>
evaluate</H3>
<PRE>
public java.lang.Object <B>evaluate</B>(<A HREF="../../../org/xml/sax/InputSource.html">InputSource</A>&nbsp;source,
<A HREF="../../../javax/xml/namespace/QName.html">QName</A>&nbsp;returnType)
throws <A HREF="../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
<DL>
<DD><p>Evaluate the compiled XPath expression in the context of the specified <code>InputSource</code> and return the result as the
specified type.</p>
<p>This method builds a data model for the <A HREF="../../../org/xml/sax/InputSource.html"><CODE>InputSource</CODE></A> and calls
<A HREF="../../../javax/xml/xpath/XPathExpression.html#evaluate(java.lang.Object, javax.xml.namespace.QName)"><CODE>evaluate(Object item, QName returnType)</CODE></A> on the resulting document object.</p>
<p>See <a href="#XPathExpression-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
variable, function and QName resolution and return type conversion.</p>
<p>If <code>returnType</code> is not one of the types defined in <A HREF="../../../javax/xml/xpath/XPathConstants.html"><CODE>XPathConstants</CODE></A>,
then an <code>IllegalArgumentException</code> is thrown.</p>
<p>If <code>source</code> or <code>returnType</code> is <code>null</code>,
then a <code>NullPointerException</code> is thrown.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - The <code>InputSource</code> of the document to evaluate over.<DD><CODE>returnType</CODE> - The desired return type.<DT><B>Returns:</B><DD>The <code>Object</code> that is the result of evaluating the expression and converting the result to
<code>returnType</code>.<DT><B>Throws:</B><DD><A HREF="../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A> - If the expression cannot be evaluated.<DD>java.lang.IllegalArgumentException - If <code>returnType</code> is not one of the types defined in <A HREF="../../../javax/xml/xpath/XPathConstants.html"><CODE>XPathConstants</CODE></A>.<DD>java.lang.NullPointerException - If <code>source</code> or <code>returnType</code> is <code>null</code>.</DL>
</DD>
</DL>
<HR>
<A NAME="evaluate(org.xml.sax.InputSource)"><!-- --></A><H3>
evaluate</H3>
<PRE>
public java.lang.String <B>evaluate</B>(<A HREF="../../../org/xml/sax/InputSource.html">InputSource</A>&nbsp;source)
throws <A HREF="../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
<DL>
<DD><p>Evaluate the compiled XPath expression in the context of the specified <code>InputSource</code> and return the result as a
<code>String</code>.</p>
<p>This method calls <A HREF="../../../javax/xml/xpath/XPathExpression.html#evaluate(org.xml.sax.InputSource, javax.xml.namespace.QName)"><CODE>evaluate(InputSource source, QName returnType)</CODE></A> with a <code>returnType</code> of
<A HREF="../../../javax/xml/xpath/XPathConstants.html#STRING"><CODE>XPathConstants.STRING</CODE></A>.</p>
<p>See <a href="#XPathExpression-evaluation">Evaluation of XPath Expressions</a> for context item evaluation,
variable, function and QName resolution and return type conversion.</p>
<p>If <code>source</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - The <code>InputSource</code> of the document to evaluate over.<DT><B>Returns:</B><DD>The <code>String</code> that is the result of evaluating the expression and converting the result to a
<code>String</code>.<DT><B>Throws:</B><DD><A HREF="../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A> - If the expression cannot be evaluated.<DD>java.lang.NullPointerException - If <code>source</code> is <code>null</code>.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XPathExpression.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/xml/xpath/XPath.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/xml/xpath/XPathFunction.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="XPathExpression.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
Copyright © 2006 Apache XML Project. All Rights Reserved.
</BODY>
</HTML>