final String systemId = source.getSystemId() == null ? schemaLocation : source.getSystemId();
// Push repaired system id back into source where read sees it.
// It is perhaps a bad thing to patch the source, but this fixes
// a problem.
source.setSystemId(systemId);
final SchemaKey key = new XmlSchemaCollection.SchemaKey(targetNamespace, systemId);
XmlSchema schema = collection.getSchema(key);
if (schema != null) {
return schema;
}
if (collection.check(key)) {