//use the entity resolver provided
InputSource source = collection.schemaResolver.
resolveEntity(targetNamespace,schemaLocation,baseUri);
final String systemId = source.getSystemId() == null ? schemaLocation : source.getSystemId();
final SchemaKey key = new XmlSchemaCollection.SchemaKey(targetNamespace, systemId);
XmlSchema schema = collection.getSchema(key);
if (schema != null) {
return schema;
}
if (collection.check(key)) {