use of org.xmlunit.validation.JAXPValidator in project syndesis by syndesisio.
the class UnifiedXmlDataShapeGeneratorShapeValidityTest method createValidator.
public static Validator createValidator() {
final SchemaFactory schemaFactory = SchemaFactory.newInstance(Languages.W3C_XML_SCHEMA_NS_URI);
final Schema schema;
try {
schema = schemaFactory.newSchema(UnifiedXmlDataShapeGenerator.class.getResource("/swagger/atlas-xml-schemaset-model-v2.xsd"));
} catch (final SAXException e) {
throw new ExceptionInInitializerError(e);
}
final Validator validator = new JAXPValidator(Languages.W3C_XML_SCHEMA_NS_URI, new FixedSchemaValidator(schema));
validator.setSchemaSource(CACHED_SCHEMA);
return validator;
}
Aggregations