doc.appendChild(nd);
for (SchemaInfo schemaInfo : schemas) {
if (!useSchemaImports) {
SchemaImpl schemaImpl = new SchemaImpl();
schemaImpl.setRequired(true);
schemaImpl.setElementType(WSDLConstants.SCHEMA_QNAME);
schemaImpl.setElement(schemaInfo.getElement());
types.addExtensibilityElement(schemaImpl);
} else {
//imports
String name = baseFileName + "_schema" + (++xsdCount) + ".xsd";
Element imp = XMLUtils.createElementNS(doc,
new QName(WSDLConstants.NU_SCHEMA_XSD,
"import"));
imp.setAttribute("schemaLocation", name);
imp.setAttribute("namespace", schemaInfo.getNamespaceURI());
nd.appendChild(imp);
imports.put(name, schemaInfo);
}
// add imports for those schemata which are inlined.
addRequiredSchemaImports(schemaInfo);
}
if (useSchemaImports) {
SchemaImpl schemaImpl = new SchemaImpl();
schemaImpl.setRequired(true);
schemaImpl.setElementType(WSDLConstants.SCHEMA_QNAME);
schemaImpl.setElement(nd);
types.addExtensibilityElement(schemaImpl);
}
def.setTypes(types);
}