public bool HasAttributes(XmlNode node)
{
XmlSchemaElement element = Elements.Where(e => e.Name.Equals(node.LocalName)).FirstOrDefault();
if (element != null)
{
XmlSchemaComplexType type = element.ElementSchemaType as XmlSchemaComplexType;
if (type != null)
{
// If the complex type has any attributes, get an enumerator
// and write each attribute name to the Debug.
if (type.AttributeUses.Count > 0)
{
return true;
}
}
}
return false;
}