Can some one kindly help me on below qurery?

I need to read the element's name of the XML schema.For an examle,The part of the XML schema is given below

     

         

         

         

          minOccurs=”0”-->

     

I wanted to read "dname","location" and "Manager" then put thse to an array that will hold the name of the elements in the XML schema. I couldn't be able to read the element's name using the below code since it's returing only "xs:element". Even I tried Localname instead of name still no results.

XmlTextReader textReader = new XmlTextReader("C:\\books.xsd");
            // Read until end of file

            while (textReader.Read())

            {

                XmlNodeType nType = textReader.NodeType;

                                if (nType == XmlNodeType.Element)

                {

                    Console.WriteLine("Element:" + textReader.Name.ToString());

                }


Thanks

 

Can some kindly get me the solution for the below query?

I need to read the element's name of the XML schema.For an examle,The part of the XML schema is given below

     

         

         

         

          minOccurs=”0”-->

     

 I wanted to read "dname","location" and "Manager" then put that to an array that will hold the name of the elements in the XML schema. I couldn't be able to read the element's name using the below code since it's returing only "xs:element". Even I tried Localname instead of name still no results.

XmlTextReader textReader = new XmlTextReader("C:\\books.xsd");
            // Read until end of file

            while (textReader.Read())

            {

                XmlNodeType nType = textReader.NodeType;

                                if (nType == XmlNodeType.Element)

                {

                    Console.WriteLine("Element:" + textReader.Name.ToString());

                }


Thanks