|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.query.QueryProcessor
A QueryProcessor allows the compilation of XQuery queries for subsequent execution. Compilation consists of parsing, static analysis, optimization, and creation of an internal representation of the query for subsequent evaluation.
The compilation of a query takes context information from a static context, which is represented by a StaticQueryContext object. This provides the necessary information about collations, base URI, etc.
This class is retained for backwards compatibility, but there is no longer any need for applications to use it directly, since all its methods are available directly from the StaticQueryContext object.
Constructor Summary | |
QueryProcessor(StaticQueryContext env)
Deprecated. since Saxon 8.1: use methods on the StaticQueryContext directly |
Method Summary | |
DocumentInfo |
buildDocument(javax.xml.transform.Source source)
Deprecated. Convenience method for building Saxon's internal representation of a source XML document. |
XQueryExpression |
compileQuery(java.io.Reader source)
Deprecated. Prepare an XQuery query for subsequent evaluation. |
XQueryExpression |
compileQuery(java.lang.String query)
Deprecated. Prepare an XQuery query for subsequent evaluation. |
Configuration |
getConfiguration()
Deprecated. Get the configuration used by this QueryProcessor |
StaticQueryContext |
getStaticContext()
Deprecated. Get the current static context |
void |
setConfiguration(Configuration config)
Deprecated. Set the configuration. |
void |
setStaticContext(StaticQueryContext context)
Deprecated. Set the static context for compiling XQuery expressions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QueryProcessor(StaticQueryContext env)
env
- the static context for queries. Note that a StaticQueryContext object may be initialized with
context information that the query can use, but it is also modified when a query is compiled against
it: for example, namespaces, variables, and functions declared in the query prolog are registered in
the static context. Therefore, it is not a good idea to use a StaticQueryContext object to compile more
than one query.Method Detail |
public DocumentInfo buildDocument(javax.xml.transform.Source source) throws XPathException
source
- Any javax.xml.transform.Source object representing the document against
which queries will be executed. Note that a Saxon DocumentInfo
(indeed any NodeInfo
)
can be used as a Source. To use a third-party DOM Document as a source, create an instance of
DOMSource
to wrap it.
For additional control over the way in which the source document is processed,
supply an AugmentedSource
object and set appropriate options on the object.
XPathException
public void setStaticContext(StaticQueryContext context)
public StaticQueryContext getStaticContext()
public void setConfiguration(Configuration config)
public Configuration getConfiguration()
public XQueryExpression compileQuery(java.lang.String query) throws XPathException
query
- The XQuery query to be evaluated, supplied as a string.
XPathException
- if the syntax of the expression is wrong,
or if it references namespaces, variables, or functions that have not been declared,
or contains other static errors.public XQueryExpression compileQuery(java.io.Reader source) throws XPathException, java.io.IOException
source
- A Reader giving access to the text of the XQuery query to be compiled.
XPathException
- if the syntax of the expression is wrong, or if it references namespaces,
variables, or functions that have not been declared, or any other static error is reported.
java.io.IOException
- if a failure occurs reading the supplied input.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |