CSharp examples for System.Xml:XML Element
Get All Simple Elements from XmlSchemaElement
using System.Xml.Schema; using System.Xml; using System.Text; using System.Linq; using System.Diagnostics; using System.Collections.Generic; using System.Collections; using System;//www.j a v a 2 s. c o m public class Main{ public static List<XmlSchemaElement> GetAllSimpleElements(List<XmlSchemaElement> elements) { List<XmlSchemaElement> simpleElementList = new List<XmlSchemaElement>(); foreach (XmlSchemaElement element in elements) { if (IsSimpleType(element)) simpleElementList.Add(element); } return simpleElementList; } }