Class TransformErrorListener

java.lang.Object
org.dellroad.stuff.xml.TransformErrorListener
All Implemented Interfaces:
ErrorListener

public class TransformErrorListener extends Object implements ErrorListener
ErrorListener implementation that logs the messages to a configured Logger and throws exceptions in cases of errors and fatal errors.

This class also optionally works around some stupid Xalan-J bugs:

  • Throw exceptions in the case of warning(javax.xml.transform.TransformerException) also; this is required because Xalan-J reports even <message terminate="yes"> messages as warnings
  • When throwing exceptions, wrap them in RuntimeExceptions to avoid being swallowed; otherwise Xalan-J will not terminate on a <message terminate="yes">

In addition, by overriding isIgnorable() subclasses can ignore chosen issues.