Subject: Re: [xsl] sorted table elements From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Fri, 04 Oct 2002 12:02:46 +0200 |
<xsl:variable name="sortedElements"> <xsl:for-each select="*"> <xsl:sort data-type="text" select="name()"/> <xsl:copy-of select="."/> </xsl:for-each> </xsl:variable>
<xsl:for-each select="$sortedElementsNodeSet[position() mod 4 = 1"> <tr> <xsl:for-each select=".|following-sibling::node()[position() < 4]"> <td>...</td> </xsl:for-each> </tr> </xsl:for-each>
Hello,
I'd like to produce a 4 column HTML table where each <td> element is alphabetically sorted from cell 1,1 to cell n,4 (where n is the required number of rows).
The following is an attempt:
<table> <xsl:for-each select="*[position() mod 4 = 1]"> <xsl:sort data-type="text" select="name()"/> <tr> <xsl:for-each select=".|following-sibling::node()[position() < 4]"> <td>...</td> </xsl:for-each> </tr> </xsl:for-each> </table>
This code only sorts all the *[position() mod 4 = 1] elements. Therefore, only column one is sorted, whereas I wanted the entire table (an linear list from cell 1,1 to cell n,4 sorted). Can this be done?
Thank You and Best Regards,
S. Perugini
System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 joerg.heinicke@xxxxxxxxx www.virbus.de
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] sorted table elements, Saverio Perugini | Thread | [xsl] Resource recommendations for , Carrie Kaufman |
RE: [xsl] get immediat preceeding n, Andrew Welch | Date | [xsl] Grouping with keys or xpath, Ulf Carlsson |
Month |