for (String source : extensionSchema) {
schemaSources.add(new StreamSource(clazz.getResourceAsStream(source)));
}
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
schemaFactory.setResourceResolver(new ClasspathResolver());
schemaFactory.setErrorHandler(new LoggingErrorHandler(LoggerFactory.getLogger(clazz)));
return schemaFactory.newSchema(schemaSources.toArray(new StreamSource[0]));
}