String base) {
@SuppressWarnings("unchecked")
Collection<List<SchemaImport>> imports = schema.getImports().values();
for (List<SchemaImport> impList : imports) {
for (SchemaImport s : impList) {
Schema importedSchema = s.getReferencedSchema();
if (importedSchema == null) {
continue;
}
String docURI = importedSchema.getDocumentBaseURI();
String location = s.getSchemaLocationURI();
String importId = parentDocKey + "/" + location;
String docKey = docMap.get(docURI);
if (docKey == null) {
docKey = getUniqueSchemaId();
docMap.put(docURI, docKey);
schemaMap.put(docKey, s);
updateSchemaImports(docKey, importedSchema, docMap, base);
}
importMap.put(importId, docKey);
}
}
@SuppressWarnings("unchecked")
List<SchemaReference> includes = schema.getIncludes();
for (SchemaReference s : includes) {
Schema includedSchema = s.getReferencedSchema();
if (includedSchema == null) {
continue;
}
String docURI = includedSchema.getDocumentBaseURI();
String location = s.getSchemaLocationURI();
String importId = parentDocKey + "/" + location;
String docKey = docMap.get(docURI);
if (docKey == null) {
docKey = getUniqueSchemaId();