/** * Returns the XML-Error handler that should be registered with the XML parser. By default, this returns a logger. * * @return the error handler. */ protected ErrorHandler getErrorHandler() { return new LoggingErrorHandler(); } }
final DocumentBuilder db = dbf.newDocumentBuilder(); db.setEntityResolver( ParserEntityResolver.getDefaultResolver() ); db.setErrorHandler( new LoggingErrorHandler() ); final ResourceDataInputSource input = new ResourceDataInputSource( data, manager ); return new DomResource( data.getKey(), db.parse( input ), data.getVersion( manager ) );