|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.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.
Constructor Summary | |
QueryProcessor(StaticQueryContext env)
Default constructor. |
Method Summary | |
DocumentInfo |
buildDocument(javax.xml.transform.Source source)
Convenience method for building Saxon's internal representation of a source XML document. |
XQueryExpression |
compileQuery(java.io.Reader source)
Prepare an XQuery query for subsequent evaluation. |
XQueryExpression |
compileQuery(java.lang.String query)
Prepare an XQuery query for subsequent evaluation. |
Configuration |
getConfiguration()
Get the configuration |
StaticQueryContext |
getStaticContext()
Get the current static context |
void |
setConfiguration(Configuration config)
Set the configuration. |
void |
setStaticContext(StaticQueryContext context)
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)
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
javax.xml.transform.dom.DOMSource to wrap it. Note that this currently creates a copy of the
document, and any NodeInfo returned as a result of an expression will be a reference to the
copy, not to the original node.
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 |