XSLT transformations can fail for any of several reasons, including:
The stylesheet is syntactically incorrect.
The source document is malformed.
Some external resource the processor needs to load,
such as a document referenced by the
document() function
or the .class
file that implements an extension function,
is not available.
By default, any such problems are reported by printing them on
System.err. However, you can provide
more sophisticated error handling, reporting, and logging by
implementing the ErrorListener
interface.
package javax.xml.transform;
public interface ErrorListener {
public void warning(TransformerException exception)
throws TransformerException;
public void error(TransformerException exception)
throws TransformerException;
public void fatalError(TransformerException exception)
throws TransformerException;
}