XSParticle particle = (XSParticle)particles.item(j);
XSTerm term = particle.getTerm();
switch(term.getType())
{
case XSConstants.ELEMENT_DECLARATION:
XSElementDeclaration element = ((XSElementDeclaration)term);
sharedElements.add(element);
break;
case XSConstants.WILDCARD:
break;
case XSConstants.MODEL_GROUP:
default:
throw new JBossXBRuntimeException(
"For now we don't support anything but elements in global model groups"
);
}
}
}
XSNamedMap types = model.getComponents(XSConstants.TYPE_DEFINITION);
for(int i = 0; i < types.getLength(); ++i)
{
XSTypeDefinition type = (XSTypeDefinition)types.item(i);
if(!Constants.NS_XML_SCHEMA.equals(type.getNamespace()))
{
bindType(schema, type, sharedElements);
}
}
XSNamedMap elements = model.getComponents(XSConstants.ELEMENT_DECLARATION);
for(int i = 0; i < elements.getLength(); ++i)
{
XSElementDeclaration element = (XSElementDeclaration)elements.item(i);
bindElement(schema, element, sharedElements, false);
}
return schema;
}