// must have a name
if (strNameAttr == null) {
reportSchemaError("s4s-att-must-appear", new Object[]{"group (global)", "name"}, elmNode);
}
XSGroupDecl group = null;
XSParticleDecl particle = null;
// must have at least one child
Element l_elmChild = DOMUtil.getFirstChildElement(elmNode);
if (l_elmChild == null) {
reportSchemaError("s4s-elt-must-match", new Object[]{"group (global)", "(annotation?, (all | choice | sequence))"}, elmNode);
} else {
String childName = l_elmChild.getLocalName();
if (childName.equals(SchemaSymbols.ELT_ANNOTATION)) {
traverseAnnotationDecl(l_elmChild, attrValues, true, schemaDoc);
l_elmChild = DOMUtil.getNextSiblingElement(l_elmChild);
if (l_elmChild != null)
childName = l_elmChild.getLocalName();
}
if (l_elmChild == null) {
reportSchemaError("s4s-elt-must-match", new Object[]{"group (global)", "(annotation?, (all | choice | sequence))"}, elmNode);
} else if (childName.equals(SchemaSymbols.ELT_ALL)) {
particle = traverseAll(l_elmChild, schemaDoc, grammar, CHILD_OF_GROUP);
} else if (childName.equals(SchemaSymbols.ELT_CHOICE)) {
particle = traverseChoice(l_elmChild, schemaDoc, grammar, CHILD_OF_GROUP);
} else if (childName.equals(SchemaSymbols.ELT_SEQUENCE)) {
particle = traverseSequence(l_elmChild, schemaDoc, grammar, CHILD_OF_GROUP);
} else {
Object[] args = new Object [] { "group", childName};
reportSchemaError("GroupContentRestricted", args, l_elmChild);
}
if (l_elmChild != null &&
DOMUtil.getNextSiblingElement(l_elmChild) != null) {
Object[] args = new Object [] { "group", childName};
reportSchemaError("GroupContentRestricted", args, l_elmChild);
}
// add global group declaration to the grammar
if (strNameAttr != null) {
group = new XSGroupDecl();
group.fName = strNameAttr;
group.fTargetNamespace = schemaDoc.fTargetNamespace;
group.fParticle = particle;
grammar.addGlobalGroupDecl(group);
}