in taverna-wsdl-generic/src/main/java/org/apache/taverna/wsdl/parser/WSDL11Parser.java [702:740]
private void addXmlSchemas(XmlSchemaCollection xmlSchemaCollection, Definition definition) throws IOException {
xmlSchemaCollection.setNamespaceContext(new NamespaceMap(definition.getNamespaces()));
SchemaResolver resolver = new SchemaResolver(definition.getDocumentBaseURI());
xmlSchemaCollection.setSchemaResolver(resolver);
Types types = definition.getTypes();
if (types != null) {
List elements = types.getExtensibilityElements();
for (Object o : elements) {
if (o instanceof Schema) {
Schema schema = (Schema) o;
Element element = schema.getElement();
if (element != null) {
resolver.add(element);
}
}
}
for (Element element : resolver) {
InputSource source = resolver.getInputSource(element);
String publicId = source.getPublicId();
if ((publicId.isEmpty() && xmlSchemaCollection.getXmlSchema(source.getSystemId()).length == 0) ||
xmlSchemaCollection.schemaForNamespace(publicId) == null) {
xmlSchemaCollection.read(source);
}
}
}
// process imported schemas
Map imports = definition.getImports();
if (imports != null) {
for (Iterator<List<Import>> iter = imports.values().iterator(); iter.hasNext();) {
for (Import _import : iter.next()) {
addXmlSchemas(xmlSchemaCollection, _import.getDefinition());
}
}
}
}