Get All Simple Elements from XmlSchemaElement - CSharp System.Xml

CSharp examples for System.Xml:XML Element

Description

Get All Simple Elements from XmlSchemaElement

Demo Code


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;
        }
}

Related Tutorials