reading xml and counting node

Posted by Nvskhan under C# on 5/16/2014 | Points: 10 | Views : 329 | Status : [Member] | Replies : 1

i have a xml which contain some integer value, i have to check value is greater than 100 or not. if its greater than 100 then i need to increment one value and in the end i have to produce number of node has more than 100 value.

the sample xml is,

<Module Name="LexisNexis.Alerts.dll" AssemblyVersion="" FileVersion="">
<Metric Name="MaintainabilityIndex" Value="84" />
<Metric Name="CyclomaticComplexity" Value="2,178" />
<Metric Name="ClassCoupling" Value="448" />
<Metric Name="DepthOfInheritance" Value="7" />
<Metric Name="LinesOfCode" Value="4,120" />


Posted by: Sheonarayan on: 5/19/2014 [Administrator] HonoraryPlatinum | Points: 25

You can do it by modifying the XML file however that is little tedious as you will have to use many other namespaces of respective classes.

I would recommend reading it into DataSet, modifying the data and regenerating the xml file similar to explained in this article


Sheo Narayan

Nvskhan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response