}
try
{
// Create a ContentHandler to handle parsing of the stylesheet.
TemplatesHandler templatesHandler = transformerFactory.newTemplatesHandler();
// Create an XMLReader and set its ContentHandler.
XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setContentHandler(templatesHandler);
// Set it to solve Entities via cache
reader.setEntityResolver(new TransformDTDEntityResolver(dtds));
//
// Get the stylesheet's content from the deployment
//
java.io.FileInputStream is = new java.io.FileInputStream(xslt);
InputStreamReader ssreader = new InputStreamReader(is);
// Parse the stylesheet.
final InputSource xstyle = new InputSource(ssreader);
xstyle.setSystemId(xslt);
reader.parse(xstyle);
//Get the Templates object from the ContentHandler.
Templates templates = templatesHandler.getTemplates();
// Create a ContentHandler to handle parsing of the XML source.
TransformerHandler handler = transformerFactory.newTransformerHandler(templates);
// Reset the XMLReader's ContentHandler.