This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: sorting by position?
- From: Joerg Heinicke <joerg dot heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 13 Jun 2002 06:49:39 +0200
- Subject: Re: [xsl] sorting by position?
- References: <5.1.0.14.2.20020612224508.02f42ee0@objectsbydesign.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
<xsl:for-each select="row">
<xsl:sort select="column[$sortcol]"/>
<!-- rows sorted by the $sortcol'th <column/> -->
</xsl:for-each>
Regards,
Joerg
Stuart Zakon wrote:
Is there any way to sort using <xsl:sort> for a positional sort?
For instance, given the following XML for a generic table, is there
a way to specify to sort the rows by the first or second column, depending
on which column is chosen to sort by?
<?xml version="1.0" encoding="ISO-8859-1"?>
<table>
<row>
<column>x</column>
<column>b</column>
</row>
<row>
<column>z</column>
<column>c</column>
</row>
<row>
<column>y</column>
<column>a</column>
</row>
</table>
Thanks,
Stuart Zakon
Objects by Design
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list