if (logger.isDebugEnabled()) {
logger.debug("About to transform: " + DomUtil.domToString(doc));
}
DocumentSource source = new DocumentSource(doc);
DocumentResult result = new DocumentResult();
try {
synchronized(transformer) {
transformer.transform(source, result);
}
} catch (TransformerException e) {
logger.error("internalProcess: exception while transforming document.", e);
logger.error("offending document was: " + DomUtil.domToString(doc));
return null;
}
// retrieve resultant document
doc = result.getDocument();
if (logger.isDebugEnabled()) {
logger.debug("Transformed: " + DomUtil.domToString(doc));
}