Code example for TransformerException

Methods: getLocationAsString, getMessage

0
  } 
 
  private final class LoggingErrorListener implements ErrorListener {
 
    private void logTransformerException(TransformerException e) {
      final StringBuilder message = new StringBuilder(e.getMessage());
 
      if (e.getLocationAsString() != null) {
        message.append(" at ").append(e.getLocationAsString());
      } 
 
      m_logger.error(message.toString());
    } 
 
    public void warning(TransformerException e) throws TransformerException {
      logTransformerException(e);
    } 
 
    public void error(TransformerException e) throws TransformerException {
      logTransformerException(e);
      throw e;