XSDocumentInfo schemaDoc, SchemaGrammar grammar,
XSComplexTypeDecl enclosingCT) {
Element child=null;
XSAttributeGroupDecl tempAttrGrp = null;
XSAttributeUseImpl tempAttrUse = null;
XSAttributeUse otherUse = 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) continue;
if (tempAttrUse.fUse == SchemaSymbols.USE_PROHIBITED) {
attrGrp.addAttributeUse(tempAttrUse);
continue;
}
otherUse = attrGrp.getAttributeUseNoProhibited(
tempAttrUse.fAttrDecl.getNamespace(),
tempAttrUse.fAttrDecl.getName());
if (otherUse==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 if (otherUse != tempAttrUse) {
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 ) continue;
XSObjectList attrUseS = tempAttrGrp.getAttributeUses();
XSAttributeUseImpl oneAttrUse;
int attrCount = attrUseS.getLength();
for (int i=0; i<attrCount; i++) {
oneAttrUse = (XSAttributeUseImpl)attrUseS.item(i);
if (oneAttrUse.fUse == SchemaSymbols.USE_PROHIBITED) {
attrGrp.addAttributeUse(oneAttrUse);