Object[] arguments = (Object[]) argument;
Schema schema = (Schema) arguments[0];
String prefix = (String) arguments[1];
prefix = prefix.toUpperCase();
SchemaGenerator sg = (SchemaGenerator) arguments[2];
List<AttributeType> types = sg.sort();
stringBuffer.append(TEXT_2);
Map<String, String> ns2import = new HashMap<String, String>();
for (Schema imported : sg.getImports()) {
String fullClassName = imported.getClass().getName();
String className = fullClassName.substring(fullClassName.lastIndexOf(".")+1);
ns2import.put(imported.getURI(), className);
stringBuffer.append(TEXT_3);
stringBuffer.append(fullClassName);
stringBuffer.append(TEXT_4);
}
stringBuffer.append(TEXT_5);
stringBuffer.append(prefix);
stringBuffer.append(TEXT_6);
Map<Name, String> typeBindings = sg.getTypeBindings();
for (AttributeType type : types) {
Name name = type.getName();
stringBuffer.append(TEXT_7);
XSDTypeDefinition xsdType = sg.getXSDType(type);
StringWriter writer = new StringWriter();
SAXTransformerFactory txFactory =
(SAXTransformerFactory) SAXTransformerFactory.newInstance();
TransformerHandler xmls;