d = copy(d);
ns = serviceInfo.getInterface().getName().getNamespaceURI();
d.getDocumentElement().setAttribute("targetNamespace", ns);
}
SchemaInfo schemaInfo = serviceInfo.getSchema(ns);
if (schemaInfo != null && (systemId == null && schemaInfo.getSystemId() == null
|| systemId != null && systemId.equalsIgnoreCase(schemaInfo.getSystemId()))) {
return schemaInfo.getSchema();
}
if (hackAroundEmptyNamespaceIssue) {
d = doEmptyNamespaceHack(d);
}
Node n = d.getDocumentElement().getFirstChild();
while (n != null) {
if (n instanceof Element) {
Element e = (Element)n;
if (e.getLocalName().equals("import")) {
e.removeAttribute("schemaLocation");
updateSchemaLocation(e);
}
}
n = n.getNextSibling();
}
SchemaInfo schema = new SchemaInfo(ns);
schema.setSystemId(systemId);
XmlSchema xmlSchema;
synchronized (d) {
xmlSchema = col.read(d, systemId, null);
schema.setSchema(xmlSchema);
}
serviceInfo.addSchema(schema);
return xmlSchema;
}