I am working on a C# code. I have my XML document with with different nodes, Out of which I need to count the number of nodes having the same innertext value. I am Using XmlDocument. Let's say I have a xml file where I have to count the number of nodes having InnerText value BSS.
Code:
<Annotations>
<Objects>
<ObjectId>BSS</ObjectId>
<ObjectId>CAT</ObjectId>
</Objects>
<Objects>
<ObjectId>BSS</ObjectId>
<ObjectId>ABC</ObjectId>
</Objects>
<Objects>
<ObjectId>BSS</ObjectId>
<ObjectId>PCT</ObjectId>
</Objects>
<Annotations>
Here in the Above code I want to count the number of nodes having innertext value BSS.like here the count should be 3.Your help will be greatly appreciated.
No comments:
Post a Comment