String str1 = (String)paramArrayOfObject[XSAttributeChecker.ATTIDX_DEFAULT];
String str2 = (String)paramArrayOfObject[XSAttributeChecker.ATTIDX_FIXED];
XInt localXInt = (XInt)paramArrayOfObject[XSAttributeChecker.ATTIDX_FORM];
String str3 = (String)paramArrayOfObject[XSAttributeChecker.ATTIDX_NAME];
QName localQName = (QName)paramArrayOfObject[XSAttributeChecker.ATTIDX_TYPE];
XSAttributeDecl localXSAttributeDecl = null;
if (this.fSchemaHandler.fDeclPool != null)
localXSAttributeDecl = this.fSchemaHandler.fDeclPool.getAttributeDecl();
else
localXSAttributeDecl = new XSAttributeDecl();
if (str3 != null)
str3 = this.fSymbolTable.addSymbol(str3);
String str4 = null;
XSComplexTypeDecl localXSComplexTypeDecl = null;
short s1 = 0;
if (paramBoolean)
{
str4 = paramXSDocumentInfo.fTargetNamespace;
s1 = 1;
}
else
{
if (paramXSComplexTypeDecl != null)
{
localXSComplexTypeDecl = paramXSComplexTypeDecl;
s1 = 2;
}
if (localXInt != null)
{
if (localXInt.intValue() == 1)
str4 = paramXSDocumentInfo.fTargetNamespace;
}
else if (paramXSDocumentInfo.fAreLocalAttributesQualified)
str4 = paramXSDocumentInfo.fTargetNamespace;
}
ValidatedInfo localValidatedInfo = null;
short s2 = 0;
if (paramBoolean)
if (str2 != null)
{
localValidatedInfo = new ValidatedInfo();
localValidatedInfo.normalizedValue = str2;
s2 = 2;
}
else if (str1 != null)
{
localValidatedInfo = new ValidatedInfo();
localValidatedInfo.normalizedValue = str1;
s2 = 1;
}
Element localElement = DOMUtil.getFirstChildElement(paramElement);
XSAnnotationImpl localXSAnnotationImpl = null;
if ((localElement != null) && (DOMUtil.getLocalName(localElement).equals(SchemaSymbols.ELT_ANNOTATION)))
{
localXSAnnotationImpl = traverseAnnotationDecl(localElement, paramArrayOfObject, false, paramXSDocumentInfo);
localElement = DOMUtil.getNextSiblingElement(localElement);
}
else
{
localObject1 = DOMUtil.getSyntheticAnnotation(paramElement);
if (localObject1 != null)
localXSAnnotationImpl = traverseSyntheticAnnotation(paramElement, (String)localObject1, paramArrayOfObject, false, paramXSDocumentInfo);
}
Object localObject1 = null;
int i = 0;
Object localObject2;
if (localElement != null)
{
localObject2 = DOMUtil.getLocalName(localElement);
if (((String)localObject2).equals(SchemaSymbols.ELT_SIMPLETYPE))
{
localObject1 = this.fSchemaHandler.fSimpleTypeTraverser.traverseLocal(localElement, paramXSDocumentInfo, paramSchemaGrammar);
i = 1;
localElement = DOMUtil.getNextSiblingElement(localElement);
}
}
if ((localObject1 == null) && (localQName != null))
{
localObject2 = (XSTypeDefinition)this.fSchemaHandler.getGlobalDecl(paramXSDocumentInfo, 7, localQName, paramElement);
if ((localObject2 != null) && (((XSTypeDefinition)localObject2).getTypeCategory() == 16))
localObject1 = (XSSimpleType)localObject2;
else
reportSchemaError("src-resolve", new Object[] { localQName.rawname, "simpleType definition" }, paramElement);
}
if (localObject1 == null)
localObject1 = SchemaGrammar.fAnySimpleType;
if (localXSAnnotationImpl != null)
{
localObject2 = new XSObjectListImpl();
((XSObjectListImpl)localObject2).add(localXSAnnotationImpl);
}
else
{
localObject2 = XSObjectListImpl.EMPTY_LIST;
}
localXSAttributeDecl.setValues(str3, str4, (XSSimpleType)localObject1, s2, s1, localValidatedInfo, localXSComplexTypeDecl, (XSObjectList)localObject2);
if ((paramBoolean) && (str3 != null))
paramSchemaGrammar.addGlobalAttributeDecl(localXSAttributeDecl);
if (str3 == null)
{
if (paramBoolean)
reportSchemaError("s4s-att-must-appear", new Object[] { SchemaSymbols.ELT_ATTRIBUTE, SchemaSymbols.ATT_NAME }, paramElement);
else
reportSchemaError("src-attribute.3.1", null, paramElement);
str3 = "(no name)";
}
if (localElement != null)
reportSchemaError("s4s-elt-must-match.1", new Object[] { str3, "(annotation?, (simpleType?))", DOMUtil.getLocalName(localElement) }, localElement);
if ((str1 != null) && (str2 != null))
reportSchemaError("src-attribute.1", new Object[] { str3 }, paramElement);
if ((i != 0) && (localQName != null))
reportSchemaError("src-attribute.4", new Object[] { str3 }, paramElement);
checkNotationType(str3, (XSTypeDefinition)localObject1, paramElement);
if (localValidatedInfo != null)
{
this.fValidationState.setNamespaceSupport(paramXSDocumentInfo.fNamespaceSupport);
try
{
checkDefaultValid(localXSAttributeDecl);
}
catch (InvalidDatatypeValueException localInvalidDatatypeValueException)
{
reportSchemaError(localInvalidDatatypeValueException.getKey(), localInvalidDatatypeValueException.getArgs(), paramElement);
reportSchemaError("a-props-correct.2", new Object[] { str3, localValidatedInfo.normalizedValue }, paramElement);
}
}
if ((localValidatedInfo != null) && (((XSSimpleType)localObject1).isIDType()))
reportSchemaError("a-props-correct.3", new Object[] { str3 }, paramElement);
if ((str3 != null) && (str3.equals(XMLSymbols.PREFIX_XMLNS)))
reportSchemaError("no-xmlns", null, paramElement);
if ((str4 != null) && (str4.equals(SchemaSymbols.URI_XSI)))
reportSchemaError("no-xsi", new Object[] { SchemaSymbols.URI_XSI }, paramElement);
if (localXSAttributeDecl.getName() == null)
return null;
return (XSAttributeDecl)(XSAttributeDecl)localXSAttributeDecl;
}