child = DOMUtil.getNextSiblingElement(child);
}
}
boolean hadContent = false;
String childName = null;
XSParticleDecl particle;
fPArray.pushContext();
for (;child != null;child = DOMUtil.getNextSiblingElement(child)) {
particle = null;
childName = DOMUtil.getLocalName(child);
if (childName.equals(SchemaSymbols.ELT_ELEMENT)) {
particle = fSchemaHandler.fElementTraverser.traverseLocal(child, schemaDoc, grammar, NOT_ALL_CONTEXT, enclosingCT);
}
else if (childName.equals(SchemaSymbols.ELT_GROUP)) {
particle = fSchemaHandler.fGroupTraverser.traverseLocal(child, schemaDoc, grammar);
// A content type of all can only appear
// as the content type of a complex type definition.
if (hasAllContent(particle)) {
// don't insert the "all" particle, otherwise we won't be
// able to create DFA from this content model
particle = null;
reportSchemaError("cos-all-limited.1.2", null, child);
}
}
else if (childName.equals(SchemaSymbols.ELT_CHOICE)) {
particle = traverseChoice(child, schemaDoc, grammar, NOT_ALL_CONTEXT, enclosingCT);
}
else if (childName.equals(SchemaSymbols.ELT_SEQUENCE)) {
particle = traverseSequence(child, schemaDoc, grammar, NOT_ALL_CONTEXT, enclosingCT);
}
else if (childName.equals(SchemaSymbols.ELT_ANY)) {
particle = fSchemaHandler.fWildCardTraverser.traverseAny(child, schemaDoc, grammar);
}
else {
Object [] args;
if (choice) {
args = new Object[]{"choice", "(annotation?, (element | group | choice | sequence | any)*)", DOMUtil.getLocalName(child)};
}
else {
args = new Object[]{"sequence", "(annotation?, (element | group | choice | sequence | any)*)", DOMUtil.getLocalName(child)};
}
reportSchemaError("s4s-elt-must-match.1", args, child);
}
if (particle != null)
fPArray.addParticle(particle);
}
particle = null;
XInt minAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MINOCCURS];
XInt maxAtt = (XInt)attrValues[XSAttributeChecker.ATTIDX_MAXOCCURS];
Long defaultVals = (Long)attrValues[XSAttributeChecker.ATTIDX_FROMDEFAULT];
XSModelGroupImpl group = new XSModelGroupImpl();
group.fCompositor = choice ? XSModelGroupImpl.MODELGROUP_CHOICE : XSModelGroupImpl.MODELGROUP_SEQUENCE;
group.fParticleCount = fPArray.getParticleCount();
group.fParticles = fPArray.popContext();
group.fAnnotation = annotation;
particle = new XSParticleDecl();
particle.fType = XSParticleDecl.PARTICLE_MODELGROUP;
particle.fMinOccurs = minAtt.intValue();
particle.fMaxOccurs = maxAtt.intValue();
particle.fValue = group;