XSDocumentInfo schemaDoc, SchemaGrammar grammar,
XSComplexTypeDecl enclosingCT) {
Element child=null;
XSAttributeGroupDecl tempAttrGrp = null;
XSAttributeUseImpl tempAttrUse = null;
String childName;
for (child=firstAttr; child!=null; child=DOMUtil.getNextSiblingElement(child)) {
childName = DOMUtil.getLocalName(child);
if (childName.equals(SchemaSymbols.ELT_ATTRIBUTE)) {
tempAttrUse = fSchemaHandler.fAttributeTraverser.traverseLocal(child,
schemaDoc,
grammar,
enclosingCT);
if (tempAttrUse == null) break;
if (attrGrp.getAttributeUse(tempAttrUse.fAttrDecl.getNamespace(),
tempAttrUse.fAttrDecl.getName())==null) {
String idName = attrGrp.addAttributeUse(tempAttrUse);
if (idName != null) {
String code = (enclosingCT == null) ? "ag-props-correct.3" : "ct-props-correct.5";
String name = (enclosingCT == null) ? attrGrp.fName : enclosingCT.getName();
reportSchemaError(code, new Object[]{name, tempAttrUse.fAttrDecl.getName(), idName}, child);
}
}
else {
// REVISIT: what if one of the attribute uses is "prohibited"
String code = (enclosingCT == null) ? "ag-props-correct.2" : "ct-props-correct.4";
String name = (enclosingCT == null) ? attrGrp.fName : enclosingCT.getName();
reportSchemaError(code, new Object[]{name, tempAttrUse.fAttrDecl.getName()}, child);
}
}
else if (childName.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP)) {
//REVISIT: do we need to save some state at this point??
tempAttrGrp = fSchemaHandler.fAttributeGroupTraverser.traverseLocal(
child, schemaDoc, grammar);
if(tempAttrGrp == null ) break;
XSObjectList attrUseS = tempAttrGrp.getAttributeUses();
XSAttributeUseImpl existingAttrUse = null, oneAttrUse;
int attrCount = attrUseS.getLength();
for (int i=0; i<attrCount; i++) {
oneAttrUse = (XSAttributeUseImpl)attrUseS.item(i);
if (existingAttrUse == attrGrp.getAttributeUse(oneAttrUse.fAttrDecl.getNamespace(),
oneAttrUse.fAttrDecl.getName())) {