JXPathContext context = (JXPathContext) cocoonContext.getAttribute(Constants.JXPATH_CONTEXT);
if (context == null) {
if (cocoonContext.getClass() != HttpContext.class)
JXPathIntrospector.registerDynamicClass(cocoonContext.getClass(), CocoonContextHandler.class);
context = factory.newContext(null, cocoonContext);
context.setVariables(new KeywordVariables(Constants.APPLICATION_SCOPE, cocoonContext));
cocoonContext.setAttribute(Constants.JXPATH_CONTEXT, context);
}
return context;
}