- All Implemented Interfaces:
public class XQueryExpressionEE extends XQueryExpressionSaxon-EE version of XQueryExpression. Supports additional EE features including XQuery update, bytecode generation, document projection, streaming
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
explainPathMap()Output the path map of the query for diagnostics
getPathMap()Get the path map for the query expression
isDocumentProjectionAllowed()Ask whether document projection is allowed
isUpdateQuery()Ask whether this is an update query
newController(DynamicQueryContext env)Get a controller that can be used to execute functions in this compiled query.
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
runUpdate(DynamicQueryContext dynamicEnv)Run an updating query
runUpdate(DynamicQueryContext dynamicEnv, UpdateAgent agent)Run an updating query, writing back eligible updated node to persistent storage.
setAllowDocumentProjection(boolean allowed)Indicate that document projection is or is not allowed
Methods inherited from class net.sf.saxon.query.XQueryExpression
closeStreamIfNecessary, evaluate, evaluateSingle, explain, getBody, getChildExpression, getColumnNumber, getConfiguration, getExecutable, getExpression, getExternalVariableNames, getHostLanguage, getLineNumber, getLocation, getMainModule, getObjectName, getPackageData, getPublicId, getStackFrameMap, getSystemId, getTracingTag, initialContext, iterator, run, saveLocation, setBody, setChildExpression, usesContextItem, validateOutputProperties
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean isUpdateQuery()Ask whether this is an update query
public void setAllowDocumentProjection(boolean allowed)Indicate that document projection is or is not allowed
public boolean isDocumentProjectionAllowed()Ask whether document projection is allowed
public PathMap getPathMap()Get the path map for the query expression
- the path map (which is constructed if this has not already been done)
public Controller newController(DynamicQueryContext env) throws XPathExceptionGet a controller that can be used to execute functions in this compiled query. Functions in the query module can be found using
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.
public java.util.Set<MutableNodeInfo> runUpdate(DynamicQueryContext dynamicEnv) throws XPathExceptionRun an updating query
dynamicEnv- the dynamic context for query execution
- a set of nodes representing the roots of trees that have been modified as a result
of executing the update. Note that this method will never modify persistent data on disk; it returns
the root nodes of the affected documents (which will often be document nodes whose document-uri can
be ascertained), and it is the caller's responsibility to decide what to do with them.
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.
XPathException- if evaluation of the update query fails, or it this is not an updating query
public void runUpdate(DynamicQueryContext dynamicEnv, UpdateAgent agent) throws XPathExceptionRun an updating query, writing back eligible updated node to persistent storage.
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.
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
public void runStreamed(DynamicQueryContext dynamicEnv, javax.xml.transform.Source source, javax.xml.transform.Result result, java.util.Properties outputProperties) throws XPathExceptionRun the query in streaming mode, assuming it has been compiled for streaming
dynamicEnv- the dynamic execution context
source- the input document, as a SAXSource or StreamSource
result- the destination for the query results
outputProperties- serialization options for the query result
XPathException- if streamed evaluation of the query fails