Hi
I am using XSLT 1.0. My input looks like,
<table>
<tr>
<td/>
<td/>
<td/>
</tr>
<tr>
<td/>
<td/>
<td/>
</tr>
<tr>
<td/>
<td/>
<td/>
<td/>
</tr>
</table>
I want to know the maximum number of td in node. In this case, the maximum number of td is in 3rd tr and so my output should be 4. Need a template to do this. Thanks in advance
You need to use recursion. Basically, the running-max template listed below runs for every tr child element of a table. It is first applied for the first child tr element, calculates the number of td elements, compares it to a running max, and then continues to do the same for following siblings, if there are any.