|
|||||||||
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.
Constructor Summary | |
---|---|
protected |
XQueryExpression(Expression exp,
StaticQueryContext staticEnv,
Configuration config)
The constructor is protected, to ensure that instances can only be created using the compileQuery() methods of QueryProcessor |
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(NamePool pool)
Diagnostic method: display a representation of the compiled query on the System.err output stream. |
SequenceIterator |
iterator(DynamicQueryContext env)
Get an iterator over the results of the expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected XQueryExpression(Expression exp, StaticQueryContext staticEnv, Configuration config)
Method Detail |
---|
public List evaluate(DynamicQueryContext env) throws TransformerException
env
- Provides the dynamic query evaluation context
TransformerException
public Object evaluateSingle(DynamicQueryContext env) throws TransformerException
env
- Provides the dynamic query evaluation context
TransformerException
public SequenceIterator iterator(DynamicQueryContext env) throws TransformerException
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.
TransformerException
public void explain(NamePool pool)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |