public void warning(SAXParseException exception) { error(Prefix + "warning", exception); WarningCount++; } }
ErrorHandlerImpl eh = new ErrorHandlerImpl("Parsing", logger); eh.setRole("Validation"); this.validateSoapMessage(soapMessage, eh); int error_count = eh.getErrorCount(); int warning_count = eh.getWarningCount(); if (error_count > 0 || warning_count > 0) { String msg = "";
public Document parse(URLConnection uc, Element instruction, PrintWriter logger) throws Exception { Document doc = null; ErrorHandlerImpl eh = new ErrorHandlerImpl(null, logger); String old_config_property = System.getProperty(config_property); System.clearProperty(config_property); try { DocumentBuilder db = DBF.newDocumentBuilder(); db.setErrorHandler(eh); doc = db.parse(uc.getInputStream()); } catch (Exception e) { logger.println(e.getMessage()); } if (old_config_property != null) { System.setProperty(config_property, old_config_property); } if (eh.getErrorCount() > 0 || eh.getWarningCount() > 0) { logger.println(eh.getErrorCounts()); logger.flush(); } if (eh.getErrorCount() > 0) { return null; } return doc; }
/** * Sets up the schematron reader with all the necessary parameters. Calls * initSchematronReader() to do further setup of the validation driver. * * @param phase * The string phase name (contained in schematron file) * @return The ValidationDriver to use in validating the XML document */ ValidationDriver createSchematronDriver(String phase) { SchemaReaderLoader loader = new SchemaReaderLoader(); SchemaReader schReader = loader.createSchemaReader(SCHEMATRON_NS_URI); this.configPropBuilder = new PropertyMapBuilder(); SchematronProperty.DIAGNOSE.add(this.configPropBuilder); if (this.outputLogger == null) { this.outputLogger = new PrintWriter(System.out); } if (null != phase && !phase.isEmpty()) { this.configPropBuilder.put(SchematronProperty.PHASE, phase); } ErrorHandler eh = new ErrorHandlerImpl("Schematron", outputLogger); this.configPropBuilder.put(ValidateProperty.ERROR_HANDLER, eh); ValidationDriver validator = new ValidationDriver( this.configPropBuilder.toPropertyMap(), schReader); return validator; }
loadSchemaLists(parserConfig, schemas, dtds); Document resultDoc = null; ErrorHandlerImpl errHandler = new ErrorHandlerImpl("Parsing", logger); + input.getClass().getName()); errHandler.setRole("Validation"); if (null == resultDoc.getDoctype() && dtds.isEmpty()) { validateAgainstXMLSchemaList(resultDoc, schemas, errHandler); validateAgainstDTDList(resultDoc, dtds, errHandler); int error_count = errHandler.getErrorCount(); int warning_count = errHandler.getWarningCount(); if (error_count > 0 || warning_count > 0) { String msg = "";
/** * Sets up the schematron reader with all the necessary parameters. Calls * initSchematronReader() to do further setup of the validation driver. * * @param phase * The string phase name (contained in schematron file) * @return The ValidationDriver to use in validating the XML document */ ValidationDriver createSchematronDriver(String phase) { SchemaReaderLoader loader = new SchemaReaderLoader(); SchemaReader schReader = loader.createSchemaReader(SCHEMATRON_NS_URI); this.configPropBuilder = new PropertyMapBuilder(); SchematronProperty.DIAGNOSE.add(this.configPropBuilder); if (this.outputLogger == null) { this.outputLogger = new PrintWriter(System.out); } if (null != phase && !phase.isEmpty()) { this.configPropBuilder.put(SchematronProperty.PHASE, phase); } ErrorHandler eh = new ErrorHandlerImpl("Schematron", outputLogger); this.configPropBuilder.put(ValidateProperty.ERROR_HANDLER, eh); ValidationDriver validator = new ValidationDriver( this.configPropBuilder.toPropertyMap(), schReader); return validator; }
ErrorHandlerImpl eh = new ErrorHandlerImpl("Parsing", logger); eh.setRole("Validation"); this.validateSoapMessage(soapMessage, eh); int error_count = eh.getErrorCount(); int warning_count = eh.getWarningCount(); if (error_count > 0 || warning_count > 0) { String msg = "";
public void error(SAXParseException exception) { error(Prefix + "error", exception); ErrorCount++; }
loadSchemaLists(parserConfig, schemas, dtds); Document resultDoc = null; ErrorHandlerImpl errHandler = new ErrorHandlerImpl("Parsing", logger); + input.getClass().getName()); errHandler.setRole("Validation"); if (null == resultDoc.getDoctype() && dtds.isEmpty()) { validateAgainstXMLSchemaList(resultDoc, schemas, errHandler); validateAgainstDTDList(resultDoc, dtds, errHandler); int error_count = errHandler.getErrorCount(); int warning_count = errHandler.getWarningCount(); if (error_count > 0 || warning_count > 0) { String msg = "";
public void warning(SAXParseException exception) { error(Prefix + "warning", exception); WarningCount++; } }
public void warning(SAXParseException exception) { error(Prefix + "warning", exception); WarningCount++; } }
public void fatalError(SAXParseException exception) { error("Fatal " + Prefix + "error", exception); ErrorCount++; }
public void fatalError(SAXParseException exception) { error("Fatal " + Prefix + "error", exception); ErrorCount++; }
public void error(SAXParseException exception) { error(Prefix + "error", exception); ErrorCount++; }
public void fatalError(SAXParseException exception) { error("Fatal " + Prefix + "error", exception); ErrorCount++; }
public void error(SAXParseException exception) { error(Prefix + "error", exception); ErrorCount++; }