public DocumentBuilder getParser() throws ParserConfigurationException {
DocumentBuilder builder = factory.newDocumentBuilder();
builder.setEntityResolver(entityResolver);
builder.setErrorHandler(new ErrorHandler() {
public void error(SAXParseException exception) {
log.warn("SAX parse error (ignored)", exception);
//throw exception;
}
public void fatalError(SAXParseException exception) {
log.warn("Fatal SAX parse error (ignored)", exception);
//throw exception;
}
public void warning(SAXParseException exception) {
log.warn("SAX parse warning", exception);
}
});
return builder;
}
|