I have next xml:
<page>
<document>
<id>1001</id>
<cur>USD</cur>
<date>01.01.2009</date>
<amount>10</amount>
</document>
<document>
<id>1001</id>
<cur>USD</cur>
<date>02.01.2009</date>
<amount>15</amount>
</document>
<document>
<id>1001</id>
<cur>JPY</cur>
<date>01.01.2009</date>
<amount>5</amount>
</document>
<document>
<id>1002</id>
<cur>USD</cur>
<date>01.01.2009</date>
<amount>5</amount>
</document>
...
</page>
And I need to transform it into html. Records should be grouped by id and cur. And after each group total amount should be shown. So we want something like this:
Bill: id=1001, cur=USD
date=01.01.2009 amount=10
date=02.01.2009 amount=15
total amount=25
Bill: id=1001, cur=JPY
date=01.01.2009 amount=5
total amount=5
Bill: id=1002, cur=USD
date=01.01.2009 amount=5
total amount=5
...
How can I achieve this using XSL?
When I tried to find answer in google I found Muenchian method, but it's too complicated when we want to group result by 2 fields. I'm beginner in xsl and it's a bit difficult to me. I also found xslt 2.0 operator for-each-group. Is it supported by major browsers? Is it normally to use it or we should only rely on xslt 1.0?