wmodel.getJaxbContext().generateSchema(resolver);
} catch (Exception e2) {
throw new ToolException(msg, e2);
}
Types types = definition.createTypes();
try {
Schema schema;
schema = (Schema)extensionRegistry.createExtension(Types.class,
new QName("http://www.w3.org/2001/XMLSchema",
"schema"));
DocumentBuilder docBuilder;
docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = docBuilder.newDocument();
Element element = doc.createElement("xsd:schema");
Map<String, String> schemafileMap = wmodel.getSchemaNSFileMap();
Set<Map.Entry<String, String>> entryset = schemafileMap.entrySet();
Iterator<Map.Entry<String, String>> ite = entryset.iterator();
while (ite.hasNext()) {
Map.Entry<String, String> entry = (Map.Entry<String, String>)ite.next();
Element importelement = doc.createElement("xsd:import");
importelement.setAttribute("namespace", entry.getKey());
importelement.setAttribute("schemaLocation", entry.getValue());
element.appendChild(importelement);
}
schema.setElement(element);
types.addExtensibilityElement(schema);
definition.setTypes(types);
} catch (Exception e) {
throw new ToolException(msg, e);
}