schemaName = relativizedURI.getPath();
}
}
if (schemaName != null && !importExists(sourceSchema, schemaName)) {
Import schemaImport = new Import();
schemaImport.setSchemaLocation(schemaName);
if (importNamespace != null && !importNamespace.equals(EMPTY_STRING)) {
schemaImport.setNamespace(importNamespace);
}
sourceSchema.getImports().add(schemaImport);
if (schemaImport.getNamespace() != null) {
if(schemaImport.getNamespace().equals(javax.xml.XMLConstants.XML_NS_URI)) {
//make sure xml namespace is in the resolver so it gets declared
sourceSchema.getNamespaceResolver().put(javax.xml.XMLConstants.XML_NS_PREFIX, javax.xml.XMLConstants.XML_NS_URI);
}
String prefix = sourceSchema.getNamespaceResolver().resolveNamespaceURI(importNamespace);
//Don't need to generate prefix for default namespace