[xsl] grouping across a collection()

Subject: [xsl] grouping across a collection()
From: James Cummings <james@xxxxxxxxxxxxxxxxx>
Date: Mon, 20 Dec 2010 15:06:09 +0000
Hi there,

I have a number of files with tei:l elements in them.  So I create a collection:
<xsl:variable name="docs" select="collection($path)"/>
and then want to iterate over the collection grouping all first lines
together, all second lines together, etc. (to create a table with one
line per cell and all poems reflected across the row).


<tr><td>line1 from file1</td><td>line1 from file2</td><td>line1 from
<tr><td>line2 from file1</td><td>line2 from file2</td><td>line2 from

Currently I've been trying stuff like:

<xsl:for-each-group select="$docs//tei:l" group-by="position()">

which is clearly nonsense and just results in a table row with one
cell in it for each line in each poem. (As opposed to one row for all
first lines, second lines, etc.)

Any suggestions on the right way to do this? XSLT2 fine, as this is
just a pre-processing step.

Many thanks,


Current Thread