public static bool IsSimpleType(XmlSchemaElement element)
{
if (element.ElementSchemaType is XmlSchemaSimpleType)
return true;
if (element.ElementSchemaType is XmlSchemaComplexType)
{
XmlSchemaComplexType complexType = (XmlSchemaComplexType)element.ElementSchemaType;
if (complexType.ContentModel is XmlSchemaSimpleContent)
return true;
}
return false;
}