private static void InitAnyAttribute(XsdBuilder builder, string value)
{
builder._xso = builder._anyAttribute = new XmlSchemaAnyAttribute();
switch (builder.ParentElement)
{
case SchemaNames.Token.XsdComplexType:
if (builder._complexType.ContentModel != null)
{
builder.SendValidationEvent(SR.Sch_AttributeMutuallyExclusive, "anyAttribute");
}
if (builder._complexType.AnyAttribute != null)
{
builder.SendValidationEvent(SR.Sch_DupElement, "anyAttribute");
}
builder._complexType.AnyAttribute = builder._anyAttribute;
break;
case SchemaNames.Token.XsdSimpleContentRestriction:
if (builder._simpleContentRestriction.AnyAttribute != null)
{
builder.SendValidationEvent(SR.Sch_DupElement, "anyAttribute");
}
builder._simpleContentRestriction.AnyAttribute = builder._anyAttribute;
break;
case SchemaNames.Token.XsdSimpleContentExtension:
if (builder._simpleContentExtension.AnyAttribute != null)
{
builder.SendValidationEvent(SR.Sch_DupElement, "anyAttribute");
}
builder._simpleContentExtension.AnyAttribute = builder._anyAttribute;
break;
case SchemaNames.Token.XsdComplexContentExtension:
if (builder._complexContentExtension.AnyAttribute != null)
{
builder.SendValidationEvent(SR.Sch_DupElement, "anyAttribute");
}
builder._complexContentExtension.AnyAttribute = builder._anyAttribute;
break;
case SchemaNames.Token.XsdComplexContentRestriction:
if (builder._complexContentRestriction.AnyAttribute != null)
{
builder.SendValidationEvent(SR.Sch_DupElement, "anyAttribute");
}
builder._complexContentRestriction.AnyAttribute = builder._anyAttribute;
break;
case SchemaNames.Token.xsdAttributeGroup:
if (builder._attributeGroup.AnyAttribute != null)
{
builder.SendValidationEvent(SR.Sch_DupElement, "anyAttribute");
}
builder._attributeGroup.AnyAttribute = builder._anyAttribute;
break;
}
}