xmlSchema.getItems().add(includeElement);
}
}
} else {
if (!((NamespaceMap)xmlSchema.getNamespaceContext()).values().contains(schemaTypeName.getNamespaceURI())) {
XmlSchemaImport importElement = new XmlSchemaImport();
importElement.setNamespace(schemaTypeName.getNamespaceURI());
// Add schemaLocation on imports
String schemaLocation = (String)schemaLocationMap.get(schemaTypeName.getNamespaceURI());
importElement.setSchemaLocation(schemaLocation);
xmlSchema.getItems().add(importElement);
((NamespaceMap)xmlSchema.getNamespaceContext()).put(generatePrefix(), schemaTypeName.getNamespaceURI());
}
}
}