sr.setSchemaLocationURI(locationURI); sr.setSchemaLocationURI(locationURI);
private static void fixSchemaReferencesLocations(String basePath, Collection<SchemaReference> schemaReferences) { for (SchemaReference schemaReference : schemaReferences) { String schemaLocationURI = schemaReference.getSchemaLocationURI(); if (schemaLocationURI != null && !schemaLocationURI.startsWith(basePath) && !schemaLocationURI.startsWith(HTTP.getScheme())) { schemaReference.setSchemaLocationURI(basePath + schemaLocationURI); } } }
private String findSchemaLocation(Map<String, SchemaReference> doneSchemas, SchemaReference imp, String docBase) { String schemaLocationURI = imp.getSchemaLocationURI(); if (docBase != null && schemaLocationURI != null) { try { schemaLocationURI = getLocationURI(schemaLocationURI, docBase); } catch (Exception e) { //ignore } } if (imp.getReferencedSchema() != null) { for (Map.Entry<String, SchemaReference> e : doneSchemas.entrySet()) { if ((e.getValue().getReferencedSchema().getElement() == imp.getReferencedSchema().getElement()) && schemaLocationURI.equals(e.getKey())) { doneSchemas.put(schemaLocationURI, imp); imp.setSchemaLocationURI(e.getKey()); return e.getKey(); } } } return schemaLocationURI; }
private String findSchemaLocation(Map<String, SchemaReference> doneSchemas, SchemaReference imp, String docBase) { String schemaLocationURI = imp.getSchemaLocationURI(); if (docBase != null && schemaLocationURI != null) { try { schemaLocationURI = getLocationURI(schemaLocationURI, docBase); } catch (Exception e) { //ignore } } if (imp.getReferencedSchema() != null) { for (Map.Entry<String, SchemaReference> e : doneSchemas.entrySet()) { if ((e.getValue().getReferencedSchema().getElement() == imp.getReferencedSchema().getElement()) && schemaLocationURI.equals(e.getKey())) { doneSchemas.put(schemaLocationURI, imp); imp.setSchemaLocationURI(e.getKey()); return e.getKey(); } } } return schemaLocationURI; }
types.addExtensibilityElement(schemaImport.getReferencedSchema()); schemaImport.setSchemaLocationURI(null); importElt.removeAttribute("schemaLocation"); types.addExtensibilityElement(schemaReference.getReferencedSchema()); schemaReference.setSchemaLocationURI(null); includeElt.removeAttribute("schemaLocation"); types.addExtensibilityElement(schemaReference.getReferencedSchema()); schemaReference.setSchemaLocationURI(null); redefineElt.removeAttribute("schemaLocation");
sr.setSchemaLocationURI(locationURI); sr.setSchemaLocationURI(locationURI);
} else if (ext instanceof XmlSchemaInclude) { SchemaReference imp = schemaImpl.createInclude(); imp.setSchemaLocationURI(((XmlSchemaInclude)ext).getSchemaLocation()); } else if (ext instanceof XmlSchemaRedefine) { SchemaReference imp = schemaImpl.createRedefine(); imp.setSchemaLocationURI(((XmlSchemaRedefine)ext).getSchemaLocation());
} else if (ext instanceof XmlSchemaInclude) { SchemaReference imp = schemaImpl.createInclude(); imp.setSchemaLocationURI(((XmlSchemaInclude)ext).getSchemaLocation()); } else if (ext instanceof XmlSchemaRedefine) { SchemaReference imp = schemaImpl.createRedefine(); imp.setSchemaLocationURI(((XmlSchemaRedefine)ext).getSchemaLocation());
} else if (ext instanceof XmlSchemaInclude) { SchemaReference imp = schemaImpl.createInclude(); imp.setSchemaLocationURI(((XmlSchemaInclude)ext).getSchemaLocation()); } else if (ext instanceof XmlSchemaRedefine) { SchemaReference imp = schemaImpl.createRedefine(); imp.setSchemaLocationURI(((XmlSchemaRedefine)ext).getSchemaLocation());