| There are two ways.
If you are using XSLT 2, you just need to use the new for-each-group element.
If you are using XSLT 1, which is what most browsers and toolkits are based on at the moment, then you have to use the method invented by Steve Muench. It is a lot more work but it will get the work done in the end - that is what you care about.
With the latter method, you have to use the generate-id function, and a bunch of other stuff.
It will be nice when all the applications and libraries and frameworks out there get upgraded to XSLT 2. The greater ease of this one feature alone will probably spur more interest in XSLT.
I have included links to tutorials with good examples in them. The first one is for the simpler XSLT 2 way of doing it. The second one describes the Muenchian method for getting it to work in XSLT 1. |