A few points.
Are you using XSLT 1.0 or 2.0? You stylesheet says version="2.0". If that's the case, you don't need to use the complicated Muenchian grouping approach, you can use the much simpler xsl:for-each-group instruction.
Secondly, when posting to a forum like this, please simplify the problem to get rid of inessentials. We don't need to see a list of forty fields, when the problem would be exactly the same with four. Simplifying it not only helps us to understand the problem more easily, it also helps you to understand it.
Finally, XSLT code is a lot more readable if you use literal result elements. Instead of <xsl:element name="x" namespace=""/>, write <x/>.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|