How to get number of occurrence of any child value. From below code I have child value <Name>Network B</Name>
ie 'Network B'. Now How to find how many operatorstation node have this value.
XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:w3="http://www.w3.org">
<xsl:output method="html" indent="yes"/>
<xsl:variable name="allStations" select="//w3:OperatorStation"/>
<xsl:template match="/">
<xsl:value-of select="count($allStations[Nodes/ChildNodes/Name = 'Network B'])"/>
//Here it return 0(zero) count always
</xsl:template>
</xsl:stylesheet>
Input XML file
<?xml version="1.0" encoding="utf-8"?>
<OperatorStationCollection xmlns="http://www.w3.org" >
<OperatorStation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Nodes>
<ChildNodes>
<Name>Network A</Name>
</ChildNodes>
</Nodes>
</OperatorStation>
<OperatorStation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Nodes>
<ChildNodes>
<Name>Network B</Name>
</ChildNodes>
</Nodes>
</OperatorStation>
<OperatorStation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Nodes>
<ChildNodes>
<Name>Network A</Name>
</ChildNodes>
</Nodes>
</OperatorStation>
</OperatorStationCollection>
Desired Outout: No of occurrence of 'Network B' here its 1