XInt formAtt = (XInt) attrValues[XSAttributeChecker.ATTIDX_FORM];
String nameAtt = (String) attrValues[XSAttributeChecker.ATTIDX_NAME];
QName typeAtt = (QName) attrValues[XSAttributeChecker.ATTIDX_TYPE];
// Step 1: get declaration information
XSAttributeDecl attribute = null;
if (fSchemaHandler.fDeclPool !=null) {
attribute = fSchemaHandler.fDeclPool.getAttributeDecl();
} else {
attribute = new XSAttributeDecl();
}
// get 'name'
if (nameAtt != null)
attribute.fName = fSymbolTable.addSymbol(nameAtt);
// get 'target namespace'
if (isGlobal) {
attribute.fTargetNamespace = schemaDoc.fTargetNamespace;
attribute.setIsGlobal();
}
else {
if (enclosingCT != null)
attribute.setIsLocal(enclosingCT);
if (formAtt != null) {
if (formAtt.intValue() == SchemaSymbols.FORM_QUALIFIED)
attribute.fTargetNamespace = schemaDoc.fTargetNamespace;
else
attribute.fTargetNamespace = null;
} else if (schemaDoc.fAreLocalAttributesQualified) {
attribute.fTargetNamespace = schemaDoc.fTargetNamespace;
} else {
attribute.fTargetNamespace = null;
}
}
// get 'value constraint'
// for local named attribute, value constraint is absent
if (isGlobal) {
if (fixedAtt != null) {
attribute.fDefault = new ValidatedInfo();
attribute.fDefault.normalizedValue = fixedAtt;
attribute.setConstraintType(XSConstants.VC_FIXED);
} else if (defaultAtt != null) {
attribute.fDefault = new ValidatedInfo();
attribute.fDefault.normalizedValue = defaultAtt;
attribute.setConstraintType(XSConstants.VC_DEFAULT);
} else {
attribute.setConstraintType(XSConstants.VC_NONE);
}
}
// get 'annotation'
Element child = DOMUtil.getFirstChildElement(attrDecl);