| 
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectnet.sf.saxon.query.XQueryExpression
public class XQueryExpression
XQueryExpression represents a compiled query. This object is immutable and thread-safe, the same compiled query may be executed many times in series or in parallel. The object can be created only by using the compileQuery method of the QueryProcessor class.
Various methods are provided for evaluating the query, with different options for delivery of the results.
| Method Summary | |
|---|---|
 List | 
evaluate(DynamicQueryContext env)
Execute a the compiled Query, returning the results as a List.  | 
 Object | 
evaluateSingle(DynamicQueryContext env)
Execute the compiled Query, returning the first item in the result.  | 
 void | 
explain(Configuration config,
        PrintStream out)
Diagnostic method: display a representation of the compiled query on the selected output stream.  | 
 int | 
getColumnNumber()
Return the character position where the current document event ends.  | 
 Controller | 
getController()
Deprecated. since 8.5.1 - use newController()  | 
 Executable | 
getExecutable()
Get the Executable (representing a complete stylesheet or query) of which this Container forms part  | 
 Expression | 
getExpression()
Get the expression wrapped in this XQueryExpression object  | 
 int[] | 
getExternalVariableNames()
Get a list containing the fingerprints of the names of the external variables in the query  | 
 int | 
getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container  | 
 int | 
getLineNumber()
Return the line number where the current document event ends.  | 
 LocationProvider | 
getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved.  | 
 String | 
getPublicId()
Return the public identifier for the current document event.  | 
 SlotManager | 
getStackFrameMap()
Get the stack frame map used for the outermost level of this query  | 
 StaticQueryContext | 
getStaticContext()
Get the static context in which this expression was compiled.  | 
 String | 
getSystemId()
Return the system identifier for the current document event.  | 
 SequenceIterator | 
iterator(DynamicQueryContext env)
Get an iterator over the results of the expression.  | 
 Controller | 
newController()
Get a controller that can be used to execute functions in this compiled query.  | 
 void | 
pull(DynamicQueryContext dynamicEnv,
     Result destination,
     Properties outputProperties)
Run the query in pull mode.  | 
 boolean | 
replaceSubExpression(Expression original,
                     Expression replacement)
Replace one subexpression by a replacement subexpression.  | 
 void | 
run(DynamicQueryContext env,
    Result result,
    Properties outputProperties)
Run the query, sending the results directly to a JAXP Result object.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public Expression getExpression()
public SlotManager getStackFrameMap()
public boolean replaceSubExpression(Expression original,
                                    Expression replacement)
replaceSubExpression in interface Containeroriginal - the original subexpressionreplacement - the replacement subexpression
public StaticQueryContext getStaticContext()
public int[] getExternalVariableNames()
public List evaluate(DynamicQueryContext env)
              throws XPathException
env - Provides the dynamic query evaluation context
evaluate method
         of class XPathProcessor
XPathException
public Object evaluateSingle(DynamicQueryContext env)
                      throws XPathException
env - Provides the dynamic query evaluation context
evaluate method
XPathException
public SequenceIterator iterator(DynamicQueryContext env)
                          throws XPathException
To get the results of the query in the form of an XML document in which each item is wrapped by an element indicating its type, use:
QueryResult.wrap(iterator(env))
To serialize the results to a file, use the QueryResult.serialize() method.
env - Provides the dynamic query evaluation context
XPathException - if a dynamic error occurs in evaluating the query. Some
                        dynamic errors will not be reported by this method, but will only be reported
                        when the individual items of the result are accessed using the returned iterator.
public void run(DynamicQueryContext env,
                Result result,
                Properties outputProperties)
         throws XPathException
env - the dynamic query contextresult - the destination for the results of the query. The query is effectively wrapped
                         in a document{} constructor, so that the items in the result are concatenated to form a single
                         document; this is then written to the requested Result destination, which may be (for example)
                         a DOMResult, a SAXResult, or a StreamResultoutputProperties - Supplies serialization properties, in JAXP format, if the result is to
                         be serialized. This parameter can be defaulted to null.
XPathException - if the query fails.
public void pull(DynamicQueryContext dynamicEnv,
                 Result destination,
                 Properties outputProperties)
          throws XPathException
XPathExceptionConfiguration.setLazyConstructionMode(boolean)public Controller newController()
StaticQueryContext.getUserDefinedFunction(java.lang.String, java.lang.String, int).
 They can then be called directly from the Java application using UserFunction.call(net.sf.saxon.om.ValueRepresentation[], net.sf.saxon.expr.XPathContextMajor)
 The same Controller can be used for a series of function calls.
public Controller getController()
newController()
public void explain(Configuration config,
                    PrintStream out)
public Executable getExecutable()
getExecutable in interface Containerpublic LocationProvider getLocationProvider()
getLocationProvider in interface Containerpublic String getPublicId()
The return value is the public identifier of the document entity or of the external parsed entity in which the markup that triggered the event appears.
getPublicId in interface SourceLocatorgetSystemId()public String getSystemId()
The return value is the system identifier of the document entity or of the external parsed entity in which the markup that triggered the event appears.
If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
getSystemId in interface SourceLocatorgetPublicId()public int getLineNumber()
Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.
The return value is an approximation of the line number in the document entity or external parsed entity where the markup that triggered the event appears.
getLineNumber in interface SourceLocatorgetColumnNumber()public int getColumnNumber()
Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.
The return value is an approximation of the column number in the document entity or external parsed entity where the markup that triggered the event appears.
getColumnNumber in interface SourceLocatorgetLineNumber()public int getHostLanguage()
getHostLanguage in interface ContainerConfiguration.XSLT or Configuration.XQUERY
  | 
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||