I recently asked a question regarding how to ignore multiple elements, and got some good responses regarding using \'preceding\' and the Muenchian Method. However I was wond
If I may, although this has been answered with the Muenchian method, for over 12 years I have been promoting the variable-based grouping method for XSLT 1.0 on mail lists (e.g. http://www.sourceware.org/ml/xsl-list/2001-10/msg00933.html) and in the classroom.
The variable-based grouping method allows you to group across multiple files in one pass. It also is quite straightforward to do subgroups using the variable-based method. Whatever population you can address can be put into a variable and then the grouping method works on that variable.
I hope the illustrative transcript below helps ... you can see that the stylesheet is quite compact and you do not need two passes and you do not need to use any extension.
Data:
t:\ftemp>type multi.xml
t:\ftemp>type File1.xml
A
A
B
C
B
A
C
C
Results:
t:\ftemp>call xslt multi.xml multi.xsl
Type
Count
A
6
B
4
C
6
Stylesheet:
t:\ftemp>type multi.xsl
Type
Count