}
}
}
} else if (content instanceof XmlSchemaSimpleTypeUnion) {
XmlSchemaSimpleTypeUnion simpleTypeUnion = (XmlSchemaSimpleTypeUnion) content;
QName[] qnames = simpleTypeUnion.getMemberTypesQNames();
if (qnames != null) {
QName qname;
for (int i = 0; i < qnames.length; i++) {
qname = qnames[i];
if (baseSchemaTypeMap.containsKey(qname)) {
metaInfHolder.addMemberType(qname, baseSchemaTypeMap.get(qname));
} else {
XmlSchema resolvedSchema = getParentSchema(parentSchema, qname,
COMPONENT_TYPE);
if (resolvedSchema == null) {
throw new SchemaCompilationException("can not find the type " + qname +
" from the parent schema " +
parentSchema.getTargetNamespace());
} else {
XmlSchemaType type = resolvedSchema.getTypeByName(qname);
if (type instanceof XmlSchemaSimpleType) {
XmlSchemaSimpleType memberSimpleType = (XmlSchemaSimpleType) type;
if (!isAlreadyProcessed(qname)) {
processSimpleSchemaType(memberSimpleType, null,
resolvedSchema, null);
}
metaInfHolder.addMemberType(qname, processedTypemap.get(qname));
} else {
throw new SchemaCompilationException("Unions can not have complex types as a member type");
}
}
}
}
} else {
QName childQname;
int i = 1;
for (XmlSchemaSimpleType xmlSchemaObject : simpleTypeUnion.getBaseTypes()) {
i++;
XmlSchemaSimpleType unionSimpleType = xmlSchemaObject;
childQname = unionSimpleType.getQName();
if (childQname == null) {
// we create a fake Qname for all these simple types since most propably they don't have one