public class XQueryExpressionEE extends XQueryExpression
executable, expression, mainModule, stackFrameMap| Constructor and Description |
|---|
XQueryExpressionEE(Expression exp,
QueryModule mainModule,
boolean streaming) |
| Modifier and Type | Method and Description |
|---|---|
void |
explainPathMap()
Output the path map of the query for diagnostics
|
PathMap |
getPathMap()
Get the path map for the query expression
|
boolean |
isDocumentProjectionAllowed()
Ask whether document projection is allowed
|
boolean |
isUpdateQuery()
Ask whether this is an update query
|
Controller |
newController(DynamicQueryContext env)
Get a controller that can be used to execute functions in this compiled query.
|
void |
runStreamed(DynamicQueryContext dynamicEnv,
Source source,
Result result,
Properties outputProperties)
Run the query in streaming mode, assuming it has been compiled for streaming
|
Set<MutableNodeInfo> |
runUpdate(DynamicQueryContext dynamicEnv)
Run an updating query
|
void |
runUpdate(DynamicQueryContext dynamicEnv,
UpdateAgent agent)
Run an updating query, writing back eligible updated node to persistent storage.
|
void |
setAllowDocumentProjection(boolean allowed)
Indicate that document projection is or is not allowed
|
evaluate, evaluateSingle, explain, getColumnNumber, getConfiguration, getExecutable, getExpression, getExternalVariableNames, getHostLanguage, getLineNumber, getMainModule, getPackageData, getPublicId, getStackFrameMap, getSystemId, initialContext, iterateEvents, iterator, pull, pull, run, saveLocation, usesContextItem, validateOutputPropertiespublic XQueryExpressionEE(Expression exp, QueryModule mainModule, boolean streaming) throws XPathException
XPathExceptionpublic boolean isUpdateQuery()
isUpdateQuery in class XQueryExpressionpublic void setAllowDocumentProjection(boolean allowed)
setAllowDocumentProjection in class XQueryExpressionallowed - true if projection is allowedpublic boolean isDocumentProjectionAllowed()
isDocumentProjectionAllowed in class XQueryExpressionpublic PathMap getPathMap()
public Controller newController(DynamicQueryContext env) throws XPathException
QueryModule.getUserDefinedFunction(java.lang.String, java.lang.String, int).
They can then be called directly from the Java application using UserFunction.call(net.sf.saxon.expr.XPathContext, net.sf.saxon.om.Sequence[])
The same Controller can be used for a series of function calls. Note that the Controller should only be used
in a single thread.newController in class XQueryExpressionenv - the dynamic context for evaluationXPathException - if evaluation fails with a dynamic errorpublic Set<MutableNodeInfo> runUpdate(DynamicQueryContext dynamicEnv) throws XPathException
runUpdate in class XQueryExpressiondynamicEnv - the dynamic context for query executionOn completion of this method it is generally unsafe to rely on the contents or relationships of NodeInfo objects that were obtained before the updating query was run. Such objects may or may not reflect the results of the update operations. This is especially true in the case of nodes that are part of a subtree that has been deleted (detached from its parent). Instead, the new updated tree should be accessed by navigation from the root nodes returned by this method.
XPathException - if evaluation of the update query fails, or it this is not an updating querypublic void runUpdate(DynamicQueryContext dynamicEnv, UpdateAgent agent) throws XPathException
A node is eligible to be written back to disk if it is present in the document pool, which generally means that it was originally read using the doc() or collection() function.
On completion of this method it is generally unsafe to rely on the contents or relationships of NodeInfo objects that were obtained before the updating query was run. Such objects may or may not reflect the results of the update operations. This is especially true in the case of nodes that are part of a subtree that has been deleted (detached from its parent). Instead, the new updated tree should be accessed by navigation from the root nodes returned by this method.
If one or more eligible updated nodes cannot be written back to disk, perhaps because the URI identifies a non-updatable location, then an exception is thrown. In this case it is undefined
runUpdate in class XQueryExpressiondynamicEnv - the dynamic context for query executionagent - a callback class that is called to process each document updated by the queryXPathException - if evaluation of the update query fails, or it this is not an updating querypublic void runStreamed(DynamicQueryContext dynamicEnv, Source source, Result result, Properties outputProperties) throws XPathException
runStreamed in class XQueryExpressiondynamicEnv - the dynamic execution contextsource - the input document, as a SAXSource or StreamSourceresult - the destination for the query resultsoutputProperties - serialization options for the query resultXPathException - if streamed evaluation of the query failspublic void explainPathMap()
explainPathMap in class XQueryExpressionCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.