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,
javax.xml.transform.Source source,
javax.xml.transform.Result result,
java.util.Properties outputProperties)
Run the query in streaming mode, assuming it has been compiled for streaming
|
java.util.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
|
closeStreamIfNecessary, evaluate, evaluateSingle, explain, getColumnNumber, getConfiguration, getExecutable, getExpression, getExternalVariableNames, getHostLanguage, getLineNumber, getMainModule, getPackageData, getPublicId, getStackFrameMap, getSystemId, initialContext, iterator, pull, pull, run, saveLocation, setChildExpression, usesContextItem, validateOutputProperties
public XQueryExpressionEE(Expression exp, QueryModule mainModule, boolean streaming) throws XPathException
XPathException
public boolean isUpdateQuery()
isUpdateQuery
in class XQueryExpression
public void setAllowDocumentProjection(boolean allowed)
setAllowDocumentProjection
in class XQueryExpression
allowed
- true if projection is allowedpublic boolean isDocumentProjectionAllowed()
isDocumentProjectionAllowed
in class XQueryExpression
public 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 XQueryExpression
env
- the dynamic context for evaluationXPathException
- if evaluation fails with a dynamic errorpublic java.util.Set<MutableNodeInfo> runUpdate(DynamicQueryContext dynamicEnv) throws XPathException
runUpdate
in class XQueryExpression
dynamicEnv
- 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 XQueryExpression
dynamicEnv
- 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, javax.xml.transform.Source source, javax.xml.transform.Result result, java.util.Properties outputProperties) throws XPathException
runStreamed
in class XQueryExpression
dynamicEnv
- 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 XQueryExpression
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.