ExpressionTool.allocateSlots(expr, stackFrameMap.getNumberOfVariables(), stackFrameMap);
Controller controller = new Controller(getConfiguration());
controller.setURIResolver(new URIPreventer());
controller.setCurrentDateTime(currentDateTime);
// this is to ensure that all use-when expressions in a module use the same date and time
XPathContext dynamicContext = controller.newXPathContext();
dynamicContext = dynamicContext.newCleanContext();
((XPathContextMajor)dynamicContext).openStackFrame(stackFrameMap);
return expr.effectiveBooleanValue(dynamicContext);
}