This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: <xsl:sort> question.
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 19 Apr 2002 18:20:02 +0100
- Subject: RE: [xsl] <xsl:sort> question.
- Reply-to: xsl-list at lists dot mulberrytech dot com
>
> The version 1 will work and the version 2 will not sort
> the data, even
> though I think that these two are logically equivalent.
> Please let me know what you think? Thanks in advance!!
>
> **Version 2 - output the sorted last name**
> <xsl:template match="/addressbook/address">
> <xsl:for-each select=".">
> <xsl:sort select="name/last-name"/>
> <p>
> <xsl:value-of select="name/last-name"/>
> </p>
> </xsl:for-each>
> </xsl:template>
>
<xsl:for-each select="."> selects a single node and then sorts it, which
isn't a very useful thing to do.
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list