@Test public void testOkValidation() throws Exception { StreamSource source = new StreamSource(ResourceUtils.getClasspathResourceStream("test-part.xml")); TestValidator.validate(source); }
protected static void validate(Schema schema, Source source, String errorCode) throws Exception { if (schema == null) { throw new IllegalStateException("Schema is not initialized"); } try { Validator validator = schema.newValidator(); validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); validator.validate(source); } catch (SAXException e) { throw new CodedException(errorCode, e); } }
SchemaValidator { protected static void validate(Schema schema, Source source, String errorCode) throws Exception { if (schema == null) { throw new IllegalStateException("Schema is not initialized"); } try { Validator validator = schema.newValidator(); validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); validator.validate(source); } catch (SAXException e) { throw new CodedException(errorCode, e); } } }
SchemaValidator { protected static void validate(Schema schema, Source source, String errorCode) throws Exception { if (schema == null) { throw new IllegalStateException("Schema is not initialized"); } try { Validator validator = schema.newValidator(); validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); validator.validate(source); } catch (SAXException e) { throw new CodedException(errorCode, e); } }  }
SchemaValidator { protected static void validate(Schema schema, Source source, String errorCode) throws Exception { if (schema == null) { throw new IllegalStateException("Schema is not initialized"); } try { Validator validator = schema.newValidator(); validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); validator.validate(source); } catch (SAXException e) { throw new CodedException(errorCode, e); } }   }
SchemaValidator { protected static void validate(Schema schema, Source source, String errorCode) throws Exception { if (schema == null) { throw new IllegalStateException("Schema is not initialized"); } try { Validator validator = schema.newValidator(); validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); validator.validate(source); } catch (SAXException e) { throw new CodedException(errorCode, e); } }    }