Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Asked can't count on XMLDocument.

$
0
0
<English><id>1</id><title>Day of the dead audio</title><level>Level 1</level><foder>Day of the dead lessons</foder><part>1.Original Effortless English Lessons</part></English><English><id>2</id><title>Day of the dead vocab</title><level>Level 1</level><foder>Day of the dead lessons</foder><part>1.Original Effortless English Lessons</part></English><English><id>1</id><title>Visit To San Francisco Part 2 MS</title><level>Level 4</level><foder>Visit To San Francisco Part 1</foder><part>2.Learn Real English</part></English><English><id>1</id><title>Visit To San Francisco Part 2 MS</title><level>Level 4</level><foder>Visit To San Francisco Part 1</foder><part>2.Learn Real English</part></English>



public object query_list_info()
        {
            XDocument xml = XDocument.Load(@"XMLEffort.xml");
            List<Data> data = (from q in xml.Elements("effort").Elements("English")
                               group q by q.Element("part").Value into g
                               select new Data
                               {

                                   count_session=g.Elements("part").FirstOrDefault().Value.Count(),
                                   count_song=g.Elements("title").FirstOrDefault().Value.Count(),

}).ToList(); return data; }



Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>