CauchoResponse res)
throws IOException, ServletException
{
PageContext pageContext;
JspFactory factory = JspFactory.getDefaultFactory();
TransformerImpl xform = null;
if (transformer instanceof TransformerImpl)
xform = (TransformerImpl) transformer;
String errorPage = null;
if (xform != null)
errorPage = (String) xform.getProperty("caucho.error.page");
pageContext = factory.getPageContext(this,
req, res,
errorPage,
false,
8192, // bufferSize,
false); // autoFlush);
try {
if (xform != null) {
xform.setProperty("caucho.page.context", pageContext);
xform.setProperty("caucho.pwd", Vfs.lookup());
}
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(os);
xform.setFeature(TransformerImpl.GENERATE_LOCATION, true);
transformer.transform(source, result);
if (xform != null)
return (LineMap) xform.getProperty(TransformerImpl.LINE_MAP);
else
return null;
} catch (Exception e) {
pageContext.handlePageException(e);
} finally {
factory.releasePageContext(pageContext);
}
return null;
}