XSLContext context = new XSLContext(broker.getBrokerPool());
context.setDefaultFunctionNamespace(Factory.namespaceURI);
XSLStylesheet expr = (XSLStylesheet) stylesheet.compile(context);
AnalyzeContextInfo info = new AnalyzeContextInfo((XQueryContext)context);
info.setFlags(Expression.IN_NODE_CONSTRUCTOR);
expr.analyze(info);
if (context.optimizationsEnabled()) {
Optimizer optimizer = new Optimizer((XQueryContext) context);
expr.accept(optimizer);
if (optimizer.hasOptimized()) {
context.reset(true);
expr.resetState(true);
expr.analyze(new AnalyzeContextInfo());
}
}
System.out.println(ExpressionDumper.dump(expr));
// Log the query if it is not too large, but avoid