| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
| <!--NewPage-->
|
| <HTML>
|
| <HEAD>
|
| <!-- Generated by javadoc on Thu Nov 22 17:12:58 EST 2007 -->
|
| <TITLE>
|
| Xalan-Java 2.7.1: Class XPathImpl
|
| </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> </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="class-use/XPathImpl.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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/apache/xpath/jaxp/XPathFactoryImpl.html"><B>PREV CLASS</B></A>
|
| NEXT CLASS</FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
|
| <A HREF="XPathImpl.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <!-- =========== END OF NAVBAR =========== -->
|
|
|
| <HR>
|
| <!-- ======== START OF CLASS DATA ======== -->
|
| <H2>
|
| <FONT SIZE="-1">
|
| org.apache.xpath.jaxp</FONT>
|
| <BR>
|
| Class XPathImpl</H2>
|
| <PRE>
|
| java.lang.Object
|
| |
|
| +--<B>org.apache.xpath.jaxp.XPathImpl</B>
|
| </PRE>
|
| <HR>
|
| <DL>
|
| <DT>public class <B>XPathImpl</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A></DL>
|
|
|
| <P>
|
| The XPathImpl class provides implementation for the methods defined in |
| javax.xml.xpath.XPath interface. This provide simple access to the results |
| of an XPath expression.
|
| <P>
|
| <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> <A HREF="../../../../javax/xml/xpath/XPathExpression.html">XPathExpression</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xpath/jaxp/XPathImpl.html#compile(java.lang.String)">compile</A></B>(java.lang.String expression)</CODE>
|
|
|
| <BR>
|
| Compile an XPath expression for later evaluation.</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/apache/xpath/jaxp/XPathImpl.html#evaluate(java.lang.String, org.xml.sax.InputSource)">evaluate</A></B>(java.lang.String expression, |
| <A HREF="../../../../org/xml/sax/InputSource.html">InputSource</A> source)</CODE>
|
|
|
| <BR>
|
| Evaluate an 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> java.lang.Object</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xpath/jaxp/XPathImpl.html#evaluate(java.lang.String, org.xml.sax.InputSource, javax.xml.namespace.QName)">evaluate</A></B>(java.lang.String expression, |
| <A HREF="../../../../org/xml/sax/InputSource.html">InputSource</A> source, |
| <A HREF="../../../../javax/xml/namespace/QName.html">QName</A> returnType)</CODE>
|
|
|
| <BR>
|
| Evaluate an 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> java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xpath/jaxp/XPathImpl.html#evaluate(java.lang.String, java.lang.Object)">evaluate</A></B>(java.lang.String expression, |
| java.lang.Object item)</CODE>
|
|
|
| <BR>
|
| Evaluate an 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> java.lang.Object</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xpath/jaxp/XPathImpl.html#evaluate(java.lang.String, java.lang.Object, javax.xml.namespace.QName)">evaluate</A></B>(java.lang.String expression, |
| java.lang.Object item, |
| <A HREF="../../../../javax/xml/namespace/QName.html">QName</A> returnType)</CODE>
|
|
|
| <BR>
|
| Evaluate an <code>XPath</code> expression in the specified context 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> <A HREF="../../../../javax/xml/namespace/NamespaceContext.html">NamespaceContext</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xpath/jaxp/XPathImpl.html#getNamespaceContext()">getNamespaceContext</A></B>()</CODE>
|
|
|
| <BR>
|
| Returns the current namespace context.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> <A HREF="../../../../javax/xml/xpath/XPathFunctionResolver.html">XPathFunctionResolver</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xpath/jaxp/XPathImpl.html#getXPathFunctionResolver()">getXPathFunctionResolver</A></B>()</CODE>
|
|
|
| <BR>
|
| Returns the current function resolver.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> <A HREF="../../../../javax/xml/xpath/XPathVariableResolver.html">XPathVariableResolver</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xpath/jaxp/XPathImpl.html#getXPathVariableResolver()">getXPathVariableResolver</A></B>()</CODE>
|
|
|
| <BR>
|
| Returns the current variable resolver.</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="../../../../org/apache/xpath/jaxp/XPathImpl.html#reset()">reset</A></B>()</CODE>
|
|
|
| <BR>
|
| Reset this <code>XPath</code> to its original configuration.</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="../../../../org/apache/xpath/jaxp/XPathImpl.html#setNamespaceContext(javax.xml.namespace.NamespaceContext)">setNamespaceContext</A></B>(<A HREF="../../../../javax/xml/namespace/NamespaceContext.html">NamespaceContext</A> nsContext)</CODE>
|
|
|
| <BR>
|
| Establishes a namespace context.</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="../../../../org/apache/xpath/jaxp/XPathImpl.html#setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver)">setXPathFunctionResolver</A></B>(<A HREF="../../../../javax/xml/xpath/XPathFunctionResolver.html">XPathFunctionResolver</A> resolver)</CODE>
|
|
|
| <BR>
|
| Establishes a function resolver.</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="../../../../org/apache/xpath/jaxp/XPathImpl.html#setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver)">setXPathVariableResolver</A></B>(<A HREF="../../../../javax/xml/xpath/XPathVariableResolver.html">XPathVariableResolver</A> resolver)</CODE>
|
|
|
| <BR>
|
| Establishes a variable resolver.</TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Methods inherited from class java.lang.Object</B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE>equals,
|
| getClass,
|
| hashCode,
|
| notify,
|
| notifyAll,
|
| toString,
|
| wait,
|
| wait,
|
| wait</CODE></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <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="setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver)"><!-- --></A><H3>
|
| setXPathVariableResolver</H3>
|
| <PRE>
|
| public void <B>setXPathVariableResolver</B>(<A HREF="../../../../javax/xml/xpath/XPathVariableResolver.html">XPathVariableResolver</A> resolver)</PRE>
|
| <DL>
|
| <DD><p>Establishes a variable resolver.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#setXPathVariableResolver(javax.xml.xpath.XPathVariableResolver)">setXPathVariableResolver</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Parameters:</B><DD><CODE>resolver</CODE> - Variable Resolver</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getXPathVariableResolver()"><!-- --></A><H3>
|
| getXPathVariableResolver</H3>
|
| <PRE>
|
| public <A HREF="../../../../javax/xml/xpath/XPathVariableResolver.html">XPathVariableResolver</A> <B>getXPathVariableResolver</B>()</PRE>
|
| <DL>
|
| <DD><p>Returns the current variable resolver.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#getXPathVariableResolver()">getXPathVariableResolver</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Returns:</B><DD>Current variable resolver</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver)"><!-- --></A><H3>
|
| setXPathFunctionResolver</H3>
|
| <PRE>
|
| public void <B>setXPathFunctionResolver</B>(<A HREF="../../../../javax/xml/xpath/XPathFunctionResolver.html">XPathFunctionResolver</A> resolver)</PRE>
|
| <DL>
|
| <DD><p>Establishes a function resolver.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#setXPathFunctionResolver(javax.xml.xpath.XPathFunctionResolver)">setXPathFunctionResolver</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Parameters:</B><DD><CODE>resolver</CODE> - XPath function resolver</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getXPathFunctionResolver()"><!-- --></A><H3>
|
| getXPathFunctionResolver</H3>
|
| <PRE>
|
| public <A HREF="../../../../javax/xml/xpath/XPathFunctionResolver.html">XPathFunctionResolver</A> <B>getXPathFunctionResolver</B>()</PRE>
|
| <DL>
|
| <DD><p>Returns the current function resolver.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#getXPathFunctionResolver()">getXPathFunctionResolver</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Returns:</B><DD>Current function resolver</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setNamespaceContext(javax.xml.namespace.NamespaceContext)"><!-- --></A><H3>
|
| setNamespaceContext</H3>
|
| <PRE>
|
| public void <B>setNamespaceContext</B>(<A HREF="../../../../javax/xml/namespace/NamespaceContext.html">NamespaceContext</A> nsContext)</PRE>
|
| <DL>
|
| <DD><p>Establishes a namespace context.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#setNamespaceContext(javax.xml.namespace.NamespaceContext)">setNamespaceContext</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Parameters:</B><DD><CODE>nsContext</CODE> - Namespace context to use</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getNamespaceContext()"><!-- --></A><H3>
|
| getNamespaceContext</H3>
|
| <PRE>
|
| public <A HREF="../../../../javax/xml/namespace/NamespaceContext.html">NamespaceContext</A> <B>getNamespaceContext</B>()</PRE>
|
| <DL>
|
| <DD><p>Returns the current namespace context.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#getNamespaceContext()">getNamespaceContext</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Returns:</B><DD>Current Namespace context</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="evaluate(java.lang.String, java.lang.Object, javax.xml.namespace.QName)"><!-- --></A><H3>
|
| evaluate</H3>
|
| <PRE>
|
| public java.lang.Object <B>evaluate</B>(java.lang.String expression, |
| java.lang.Object item, |
| <A HREF="../../../../javax/xml/namespace/QName.html">QName</A> returnType) |
| throws <A HREF="../../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
|
| <DL>
|
| <DD><p>Evaluate an <code>XPath</code> expression in the specified context and return the result as the specified type.</p> |
| |
| <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec |
| for context item evaluation, |
| variable, function and <code>QName</code> 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> ( |
| <A HREF="../../../../javax/xml/xpath/XPathConstants.html#NUMBER">NUMBER</A>, |
| <A HREF="../../../../javax/xml/xpath/XPathConstants.html#STRING">STRING</A>, |
| <A HREF="../../../../javax/xml/xpath/XPathConstants.html#BOOLEAN">BOOLEAN</A>, |
| <A HREF="../../../../javax/xml/xpath/XPathConstants.html#NODE">NODE</A> or |
| <A HREF="../../../../javax/xml/xpath/XPathConstants.html#NODESET">NODESET</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>expression</code> or <code>returnType</code> is <code>null</code>, then a |
| <code>NullPointerException</code> is thrown.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#evaluate(java.lang.String, java.lang.Object, javax.xml.namespace.QName)">evaluate</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Parameters:</B><DD><CODE>expression</CODE> - The XPath expression.<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>Result of evaluating an XPath expression as an <code>Object</code> of <code>returnType</code>.<DT><B>Throws:</B><DD><A HREF="../../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A> - If <code>expression</code> 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>expression</code> or <code>returnType</code> is <code>null</code>.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="evaluate(java.lang.String, java.lang.Object)"><!-- --></A><H3>
|
| evaluate</H3>
|
| <PRE>
|
| public java.lang.String <B>evaluate</B>(java.lang.String expression, |
| java.lang.Object item) |
| throws <A HREF="../../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
|
| <DL>
|
| <DD><p>Evaluate an XPath expression in the specified context and return the result as a <code>String</code>.</p> |
| |
| <p>This method calls <A HREF="../../../../org/apache/xpath/jaxp/XPathImpl.html#evaluate(java.lang.String, java.lang.Object, javax.xml.namespace.QName)"><CODE>evaluate(String expression, 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 "Evaluation of XPath Expressions" of JAXP 1.3 spec |
| 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. |
| If <code>expression</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#evaluate(java.lang.String, java.lang.Object)">evaluate</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Parameters:</B><DD><CODE>expression</CODE> - The XPath expression.<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 <code>expression</code> cannot be evaluated.<DD>java.lang.NullPointerException - If <code>expression</code> is <code>null</code>.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="compile(java.lang.String)"><!-- --></A><H3>
|
| compile</H3>
|
| <PRE>
|
| public <A HREF="../../../../javax/xml/xpath/XPathExpression.html">XPathExpression</A> <B>compile</B>(java.lang.String expression) |
| throws <A HREF="../../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
|
| <DL>
|
| <DD><p>Compile an XPath expression for later evaluation.</p> |
| |
| <p>If <code>expression</code> contains any <CODE>XPathFunction</CODE>s, |
| they must be available via the <A HREF="../../../../javax/xml/xpath/XPathFunctionResolver.html"><CODE>XPathFunctionResolver</CODE></A>. |
| An <A HREF="../../../../javax/xml/xpath/XPathExpressionException.html"><CODE>XPathExpressionException</CODE></A> will be thrown if the <code>XPathFunction</code> |
| cannot be resovled with the <code>XPathFunctionResolver</code>.</p> |
| |
| <p>If <code>expression</code> is <code>null</code>, a <code>NullPointerException</code> is thrown.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#compile(java.lang.String)">compile</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Parameters:</B><DD><CODE>expression</CODE> - The XPath expression.<DT><B>Returns:</B><DD>Compiled XPath expression.<DT><B>Throws:</B><DD><A HREF="../../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A> - If <code>expression</code> cannot be compiled.<DD>java.lang.NullPointerException - If <code>expression</code> is <code>null</code>.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="evaluate(java.lang.String, org.xml.sax.InputSource, javax.xml.namespace.QName)"><!-- --></A><H3>
|
| evaluate</H3>
|
| <PRE>
|
| public java.lang.Object <B>evaluate</B>(java.lang.String expression, |
| <A HREF="../../../../org/xml/sax/InputSource.html">InputSource</A> source, |
| <A HREF="../../../../javax/xml/namespace/QName.html">QName</A> returnType) |
| throws <A HREF="../../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
|
| <DL>
|
| <DD><p>Evaluate an 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="../../../../org/apache/xpath/jaxp/XPathImpl.html#evaluate(java.lang.String, java.lang.Object, javax.xml.namespace.QName)"><CODE>evaluate(String expression, Object item, QName returnType)</CODE></A> on the resulting document object.</p> |
| |
| <p>See "Evaluation of XPath Expressions" section of JAXP 1.3 spec |
| 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>expression</code>, <code>source</code> or <code>returnType</code> is <code>null</code>, |
| then a <code>NullPointerException</code> is thrown.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#evaluate(java.lang.String, org.xml.sax.InputSource, javax.xml.namespace.QName)">evaluate</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Parameters:</B><DD><CODE>expression</CODE> - The XPath expression.<DD><CODE>source</CODE> - The input source of the document to evaluate over.<DD><CODE>returnType</CODE> - The desired return type.<DT><B>Returns:</B><DD>The <code>Object</code> that encapsulates the result of evaluating the expression.<DT><B>Throws:</B><DD><A HREF="../../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A> - If 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>expression</code>, <code>source</code> or <code>returnType</code> |
| is <code>null</code>.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="evaluate(java.lang.String, org.xml.sax.InputSource)"><!-- --></A><H3>
|
| evaluate</H3>
|
| <PRE>
|
| public java.lang.String <B>evaluate</B>(java.lang.String expression, |
| <A HREF="../../../../org/xml/sax/InputSource.html">InputSource</A> source) |
| throws <A HREF="../../../../javax/xml/xpath/XPathExpressionException.html">XPathExpressionException</A></PRE>
|
| <DL>
|
| <DD><p>Evaluate an 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="../../../../org/apache/xpath/jaxp/XPathImpl.html#evaluate(java.lang.String, org.xml.sax.InputSource, javax.xml.namespace.QName)"><CODE>evaluate(String expression, 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 "Evaluation of XPath Expressions" section of JAXP 1.3 spec |
| for context item evaluation, |
| variable, function and QName resolution and return type conversion.</p> |
| |
| <p>If <code>expression</code> or <code>source</code> is <code>null</code>, |
| then a <code>NullPointerException</code> is thrown.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#evaluate(java.lang.String, org.xml.sax.InputSource)">evaluate</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A><DT><B>Parameters:</B><DD><CODE>expression</CODE> - The XPath expression.<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 expression cannot be evaluated.<DD>java.lang.NullPointerException - If <code>expression</code> or <code>source</code> is <code>null</code>.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="reset()"><!-- --></A><H3>
|
| reset</H3>
|
| <PRE>
|
| public void <B>reset</B>()</PRE>
|
| <DL>
|
| <DD><p>Reset this <code>XPath</code> to its original configuration.</p> |
| |
| <p><code>XPath</code> is reset to the same state as when it was created with |
| <CODE>XPathFactory#newXPath()</CODE>. |
| <code>reset()</code> is designed to allow the reuse of existing <code>XPath</code>s |
| thus saving resources associated with the creation of new <code>XPath</code>s.</p> |
| |
| <p>The reset <code>XPath</code> is not guaranteed to have the same |
| <A HREF="../../../../javax/xml/xpath/XPathFunctionResolver.html"><CODE>XPathFunctionResolver</CODE></A>, <A HREF="../../../../javax/xml/xpath/XPathVariableResolver.html"><CODE>XPathVariableResolver</CODE></A> |
| or <A HREF="../../../../javax/xml/namespace/NamespaceContext.html"><CODE>NamespaceContext</CODE></A> <code>Object</code>s, e.g. <CODE>Object.equals(Object obj)</CODE>. |
| It is guaranteed to have a functionally equal <code>XPathFunctionResolver</code>, |
| <code>XPathVariableResolver</code> |
| and <code>NamespaceContext</code>.</p><DD><DL>
|
| <DT><B>Specified by: </B><DD><A HREF="../../../../javax/xml/xpath/XPath.html#reset()">reset</A> in interface <A HREF="../../../../javax/xml/xpath/XPath.html">XPath</A></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> </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="class-use/XPathImpl.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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/apache/xpath/jaxp/XPathFactoryImpl.html"><B>PREV CLASS</B></A>
|
| NEXT CLASS</FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
|
| <A HREF="XPathImpl.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <!-- =========== END OF NAVBAR =========== -->
|
|
|
| <HR>
|
| Copyright © 2006 Apache XML Project. All Rights Reserved.
|
| </BODY>
|
| </HTML>
|