I went through XSLT Grouping Examples and Using for-each-group for high performance XSLT . I have a problem with for-each-group.
My XML
Here is an XSLT 2.0 stylesheet using for-each-group in a recursive function (I prefer that to a named template with XSLT 2.0):
When I apply that stylesheet with Saxon 9 to the input
Introduction
XSLT and XQuery
XSLT
XSLT is used to write stylesheets.
XQuery
XQuery is used to query XML databases.
XQuery and stylesheets
XQuery is used to query XML databases.
XSLT and XQuery
XSLT
I get the result
Introduction
XSLT and XQuery
XSLT
XSLT is used to write stylesheets.
XQuery
XQuery is used to query XML databases.
XQuery and stylesheets
XQuery is used to query XML databases.
XSLT and XQuery
XSLT