Changeset 6985


Ignore:
Timestamp:
09/27/10 12:52:25 (9 years ago)
Author:
melissa
Message:

Handle XML parsing errors using SLF4J.

Eliminates annoying "[Fatal Error] :1:1 Content is not allowed in prolog" messages.

Location:
trunk/components/common/src/loci/common/xml
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/common/src/loci/common/xml/XMLTools.java

    r6896 r6985  
    127127    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); 
    128128    DocumentBuilder db = factory.newDocumentBuilder(); 
     129    db.setErrorHandler(new ParserErrorHandler()); 
    129130    return db.parse(is); 
    130131  } 
     
    400401    try { 
    401402      trans = xslt.newTransformer(); 
     403      trans.setErrorListener(new XMLListener()); 
    402404    } 
    403405    catch (TransformerConfigurationException exc) { 
     
    521523  static class XMLListener implements ErrorListener { 
    522524    public void error(TransformerException e) { 
    523       LOGGER.warn("", e); 
     525      LOGGER.debug("", e); 
    524526    } 
    525527 
    526528    public void fatalError(TransformerException e) { 
    527       LOGGER.warn("", e); 
     529      LOGGER.debug("", e); 
    528530    } 
    529531 
Note: See TracChangeset for help on using the changeset viewer.