Subject: Re: table sort
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 25 Apr 2003 13:05:06 +0200
|
<David.Pawson@xxxxxxxxxxx> wrote in message
news:9B66BBD37D5DD411B8CE00508B69700F049E1705@xxxxxxxxxxxxxxxxxxxxxxxxx
> Given a simple table like the one below,
> I need to copy it, with the content sorted by the first entry.
>
> I *thought* it should work using an identity stylesheet,
>
> with
>
> <xsl:template match="tbody">
> <tbody>
> <xsl:apply-templates>
> <xsl:sort select="row/entry[1]/para"/>
> </xsl:apply-templates>
> </tbody>
> </xsl:template>
>
> but it only works with
> <xsl:sort/>
>
Hi Dave,
Probably you wanted:
<xsl:template match="tbody">
<tbody>
<xsl:apply-templates>
<xsl:sort select="entry[1]/para"/>
</xsl:apply-templates>
</tbody>
</xsl:template>
Note that the value of the sort key is calculated relative to the selected
node. A "row" does not have a "row" child.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- table sort
- David . Pawson - Fri, 25 Apr 2003 06:17:19 -0400 (EDT)
- Dimitre Novatchev - Fri, 25 Apr 2003 06:45:36 -0400 (EDT) <=
|
|