* @see org.exist.xupdate.Modification#process()
*/
public long process(Txn transaction) throws PermissionDeniedException, LockException,
EXistException, XPathException, TriggerException {
LOG.debug("Processing xupdate:if ...");
final XQuery xquery = broker.getXQueryService();
final XQueryPool pool = xquery.getXQueryPool();
final Source source = new StringSource(selectStmt);
CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
XQueryContext context;
if(compiled == null)
{context = xquery.newContext(getAccessContext());}
else
{context = compiled.getContext();}
//context.setBackwardsCompatibility(true);
context.setStaticallyKnownDocuments(docs);
declareNamespaces(context);
declareVariables(context);
if(compiled == null)
try {
compiled = xquery.compile(context, source);
} catch (final IOException e) {
throw new EXistException("An exception occurred while compiling the query: " + e.getMessage());
}
Sequence seq = null;
try {
seq = xquery.execute(compiled, null);
} finally {
pool.returnCompiledXQuery(source, compiled);
}
if(seq.effectiveBooleanValue()) {
long mods = 0;