if (this.getLogger().isDebugEnabled()) {
getLogger().debug("Reusing Templates for " + id);
}
}
TransformerHandler handler = getTransformerFactory().newTransformerHandler(templates);
/* (VG)
From http://java.sun.com/j2se/1.4/docs/api/javax/xml/transform/TransformerFactory.html#newTemplates(javax.xml.transform.Source)
Or http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/TransformerFactory.html#newTemplates(javax.xml.transform.Source)
"Returns: Templates object capable of being used for transformation
purposes, never null."
if (handler == null) {
if (this.getLogger().isDebugEnabled()) {
getLogger().debug("Re-creating new Templates for " + id);
}
templates = getTransformerFactory().newTemplates(new SAXSource(stylesheet.getInputSource()));
putTemplates (templates, stylesheet, id);
handler = getTransformerFactory().newTransformerHandler(templates);
}
*/
handler.getTransformer().setErrorListener(new TraxErrorHandler(getLogger()));
return handler;
} catch (ProcessingException e) {
throw e;
} catch (SAXException e) {
getLogger().debug("Got SAXException. Rethrowing cause exception.", e);