1 16 17 package org.springframework.util.xml; 18 19 import org.apache.commons.logging.Log; 20 import org.xml.sax.ErrorHandler ; 21 import org.xml.sax.SAXException ; 22 import org.xml.sax.SAXParseException ; 23 24 32 public class SimpleSaxErrorHandler implements ErrorHandler { 33 34 private final Log logger; 35 36 37 41 public SimpleSaxErrorHandler(Log logger) { 42 this.logger = logger; 43 } 44 45 46 public void warning(SAXParseException ex) throws SAXException { 47 logger.warn("Ignored XML validation warning", ex); 48 } 49 50 public void error(SAXParseException ex) throws SAXException { 51 throw ex; 52 } 53 54 public void fatalError(SAXParseException ex) throws SAXException { 55 throw ex; 56 } 57 58 } 59 | Popular Tags |