if (types != null) {
List schemas = types.getExtensibilityElements();
for (Iterator iterator = schemas.iterator(); iterator.hasNext();) {
Object o = iterator.next();
if (o instanceof Schema) {
Schema unknownExtensibilityElement = (Schema) o;
QName elementType = unknownExtensibilityElement.getElementType();
if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) {
Element element = unknownExtensibilityElement.getElement();
addSchemaElement(element, namespaceMap, schemaList);
}
} else if (o instanceof UnknownExtensibilityElement) {
//This is allegedly obsolete as of axis-wsdl4j-1.2-RC3.jar which includes the Schema extension above.
//The change notes imply that imported schemas should end up in Schema elements. They don't, so this is still needed.
UnknownExtensibilityElement unknownExtensibilityElement = (UnknownExtensibilityElement) o;
Element element = unknownExtensibilityElement.getElement();
String elementNamespace = element.getNamespaceURI();
String elementLocalName = element.getNodeName();
if ("http://www.w3.org/2001/XMLSchema".equals(elementNamespace) && "schema".equals(elementLocalName)) {
addSchemaElement(element, namespaceMap, schemaList);
}