<?xml version="1.0" encoding="ISO-8859-1"?>
<users>
<user number="0775547857">
<step stepnumber="1">complete</step>
<step stepnumber="2">complete</step>
<step stepnumber="3">complete</step>
</user>
<user number="0775543754">
<step stepnumber="1">complete</step>
<step stepnumber="2">complete</step>
</user>
<user number="0777743059">
<step stepnumber="1">complete</step>
</user>
</users>
Given a number, I want to find the maximum stepnumber in the list of steps.
What i've got so far is //user[@number='0775547857']/step[@stepnumber]
And i think I have to use the fn:max function but I am having trouble on how to use the max function passing the list of step numbers.
Example : If i give number 0775547857
, the maximum step number is 3
and for 0775543754
it is 2
and so on.
Thanx a lot in advance.
Is this correct?
//user[@number='0772243950']/step[fn:max((@stepnumber))]