for-each-group

Here should go questions about transforming XML with XSLT and FOP.
ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

for-each-group

Post by ra0543 »

If I use for-each-group in the following way:

Code: Select all

<xsl:for-each-group select="collection('file:/z:/Data/Files?select=*.xml')|collection('file:/w:/?select=*.xml;recurse=yes')">
and the different files have differently named root elements (e.g. some have a root called 'box' and others have a root called 'file'), what expression should I put in the group-by attribute on this so that I group the resulting files by the name of the root element?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: for-each-group

Post by george »

Code: Select all

 group-by="/*/name()" 
works ok for me.

Best Regards,
George
George Cristian Bina
Post Reply