}
}
//next check for schema override
for (int j = 0; j < locators.size(); j++) {
XSDSchema schema = locators.get(j).locateSchema(null, namespace, location, null);
if (schema != null) {
schemas[i / 2] = schema;
break;
}
}
//if no schema override was found, parse location directly
if (schemas[i / 2] == null) {
//validate the schema location
if ( isValidating() ) {
try {
Schemas.validateImportsIncludes(location,locators,resolvers);
}
catch (IOException e) {
throw (SAXException) new SAXException( "error validating" ).initCause(e);
}
}
//parse the document
try {
schemas[i / 2] = Schemas.parse(location, locators, resolvers, uriHandlers);
} catch (Exception e) {
String msg = "Error parsing: " + location;
logger.warning(msg);
if (isStrict()) {
//strict mode, throw exception
throw (SAXException) new SAXException(msg).initCause(e);
}
}
}
}
} else {
//could not find a schemaLocation attribute, use the locators
//look for schema with locators
for (int i = 0; i < locators.size(); i++) {
XSDSchema schema = locators.get(i).locateSchema(null, uri, null, null);
if (schema != null) {
schemas = new XSDSchema[] { schema };
break;