private static void updateSchemaRefs(XmlSchema parentSchema, String name) {
for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
Object obj = iter.next();
if (obj instanceof XmlSchemaExternal) {
XmlSchemaExternal extSchema = (XmlSchemaExternal)obj;
String location = extSchema.getSchemaLocation();
if (location.length() > 0 && location.indexOf(":/") < 0 && location.indexOf("?xsd=") < 0) {
extSchema.setSchemaLocation(name + "?xsd=" + location);
}
if (extSchema.getSchema() != null) {
updateSchemaRefs(extSchema.getSchema(), name);
}
}
}
}