transformerFactory.setURIResolver(uriResolver);
Source source = new StreamSource(url.openStream(), url.toExternalForm());
Transformer transformer = transformerFactory.newTransformer(source);
if (!getLog().isDebugEnabled()) {
Controller controller = (Controller) transformer;
try {
controller.makeMessageEmitter();
controller.getMessageEmitter().setWriter(new NullWriter());
} catch (TransformerException te) {
getLog().error("Failed to redirect xsl:message output.", te);
}
}