getServletContext().getResource(xslName);
String xsltSystemID = stylesheetURL.toExternalForm(); mainStylesheet = transFact.newTemplates(
new StreamSource(xsltSystemID)); stylesheetURL = getServletContext().
getResource(xslResult);
xsltSystemID = stylesheetURL.toExternalForm(); resultStylesheet = transFact.newTemplates(
new StreamSource(xsltSystemID));
}catch (TransformerConfigurationException tce) { log("Unable to compile stylesheet", tce);
throw new UnavailableException( "Unable to compile stylesheet");
}catch (MalformedURLException mue)
{log("Unable to locate XSLT file: " + xslName); throw new UnavailableException(
"Unable to locate XSLT file: " + xslName);
}
}
–The showPage method applies a style sheet to a DOM tree. As shown in Figure