public static List<XmlSchemaAttribute> GetAttributes( XmlSchemaComplexType complexType )
{
var attributes = new List<XmlSchemaAttribute>();
if (complexType != null && complexType.ContentModel != null)
{
var items = new Dictionary<string, XmlSchemaObject>();
ExtractContentItems( complexType.ContentModel, items );
foreach (XmlSchemaObject item in items.Values)
{
var attribute = item as XmlSchemaAttribute;
if (attribute != null)
attributes.Add( attribute );
}
}
return attributes;
}