XSLT 1.0 count element with the same value in an attribute, and show it

Posted by Erick on Stack Overflow See other posts from Stack Overflow or by Erick
Published on 2010-06-03T12:09:00Z Indexed on 2010/06/03 12:24 UTC
Read the original article Hit count: 328

Filed under:
|
|
|
|

I have a variable containing:

<col p1="Newman" p2="Paul"/>
...
<col p1="Newman" p2="Paolo"/>
<col p1="Newman" p2="Paul"/>

i wold in output a table with in the first column the value of p2 and in the second the number of time it appear. For each value of p2 should i have only a row.

<table>
<tr><td>p2</td><td>num</td></tr>
<tr><td>Pault</td><td>2</td>
...
<tr><td>Paolo</td><td>1</td>
</table>

© Stack Overflow or respective owner

Related posts about xslt

Related posts about table