// and make sure to close the input stream after the schema has been loaded
IOHelper.close(is);
}
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
schemaFactory.setResourceResolver(new DefaultLSResourceResolver(getConfiguration().getCamelContext(), getConfiguration()
.getSchemaResourceUri()));
LOG.debug("Instantiating schema for validation");
return schemaFactory.newSchema(new BytesSource(bytes));
}