try {
thread.setContextClassLoader(loader);
CauchoStylesheet xsl;
AbstractStylesheetFactory factory;
if (_strictXsl)
factory = new Xsl();
else
factory = new StyleScript();
factory.setStylePath(stylePath);
factory.setClassLoader(loader);
// factory.setWorkPath(_workPath);
String className = "";
if (pwd.lookup(href).canRead()) {
int p = req.getServletPath().lastIndexOf('/');
if (p >= 0)
className += req.getServletPath().substring(0, p);
}
/*
else if (href.startsWith("/"))
href = href.substring(1);
*/
className += "/" + href;
factory.setClassName(className);
// XXX: error here
return factory.newTemplates(href);
} finally {
thread.setContextClassLoader(oldLoader);
}
}