Read only parts of an XML file

lodl

New Member
\[code\]<Peoples> <People> <Name>RadheyJang</Name> <Location>India</Location> <Work>Software Developer</Work> <Point>5</Point> <details> <People> <Name>ArunaTiwari</Name> <Location>India</Location> <Work>SoFtwareCoder</Work> <Point>3</Point> <details/> <Test>A</Test> </People> </details> <Test>NA</Test> </People></Peoples>\[/code\]I am able to Read That Xml By using below code .\[code\] XDocument xmlDoc = XDocument.Load(str); var vrresult = from a in xmlDoc.Descendants("People") select new { Name= a.Element("Name").Value, Location= a.Element("Location").Value, Point= a.Element("Point").Value }; GridView1.DataSource = vrresult; GridView1.DataBind();\[/code\]But It is reading the Contents of details also . I want to Skip reading the Content inside the details Element . Please let me know how can i skip the Content Inside the details .
 
Back
Top