daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. final ArrayList<TransformerException> errorList = new ArrayList<TransformerException>();
  2.         ErrorListener errorListener = new ErrorListener() {
  3.           @Override
  4.           public void warning(TransformerException e) throws TransformerException {
  5.             //To change body of implemented methods use File | Settings | File Templates.
  6.             log.error(e.getMessage());
  7.             errorList.add(e);
  8.           }
  9.  
  10.           @Override
  11.           public void error(TransformerException e) throws TransformerException {
  12.             //To change body of implemented methods use File | Settings | File Templates.
  13.             log.error(e.getMessage());
  14.             errorList.add(e);
  15.           }
  16.  
  17.           @Override
  18.           public void fatalError(TransformerException e) throws TransformerException {
  19.             //To change body of implemented methods use File | Settings | File Templates.
  20.             errorList.add(e);
  21.             throw e;
  22.           }
  23.       };
  24.       ...
  25.       try
  26.       {
  27.         transformer.setErrorListener(errorListener);
  28.         newDoc = transform(transformer, oldDoc);
  29.       }
  30.       catch (TransformerException e) {
  31.         log.error("Problem transforming normalized document into PUBS-XML", e);
  32.         throw e;
  33.       }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top