Wednesday, 15 July 2015

c# - linq query fails to fetch all data from xml file -



c# - linq query fails to fetch all data from xml file -

i'm trying read xml using linq not fetch info xml file. not fetch info in <text> instead reads </text>.

below linq query have used :-

var xmldocument = xdocument.load("abc.xml"); node xmldocument.root , of type xelement ienumerable<xelement> slist = xelement elt in node.elements() orderby node.elements(elt.name.localname).count() descending select elt;

// sample xml file

<logfile> <filemodel> <view> <control type="x"> <text>just test experiment</text> <visible>false</visible> </control> <control type="y"> <text>i create test experiment check if tool works</text> <visible>true</visible> </control> <control type="z"> <text>experiment test tool</text> <visible>false</visible> </control> </view> </filemodel> </logfile>

what wrong in above linq query have written. please suggest corrections.

c# .net xml linq

No comments:

Post a Comment