I'm struggling to make a counter with conditions. My XML is:
<comments>
<comment>
<name>Jonh</name>
<num>4/7</num>
</comment>
<comment>
<name>Mary</name>
<num>2/9</num>
</comment>
<comment>
<name>Catie</name>
<num>12/2</num>
</comment>
<comment>
<name>Stefen</name>
<num>127/300</num>
</comment>
</comments>
The tag has the following structure:
number1/number2
And I want to know how often the number1 is greater than the number2 in all tags
I've tried with count:
count(tokenize(//comment/num, '/')[1] > tokenize(//comment/num, '/')[2])
But no results. I thought about using a variable as an counter but they are immutable. How can I solve this?