Originally posted by Jayadev Pulaparty:
This will do it -
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="count(//salary[.=100000])"/>
</xsl:template>
</xsl:stylesheet>
Thanks, Jayadev. I am still not very clear about
the following part:
count(//salary[.=100000])
salary is a subelement, "." means contxet node,that is salary, right?
"100000" is the text node subelemnt of salary, not a attribute. How can we add this as a predicate?