Re: [xsl] Sorting with partial string

Subject: Re: [xsl] Sorting with partial string
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sat, 28 Jan 2006 18:40:02 +1100
On 1/28/06, Tim Lebo <timleboxslt@xxxxxxxxx> wrote:
> Would this break with:
>
> <list>
> <cmd>pianoman</cmd>
> <cmd>no pianoman</cmd>
> </list>
>
> i.e. the non-no component contains a substring "no"

No -- the best way is to try it.

Were more than one space allowed in the string (that is more than two
words), then the following sort key would still produce the correct
sort result:

<xsl:sort select=
           "substring(.,1+3*starts-with(.,'no '))"/>



--
Cheers,
Dimitre Novatchev
---------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all.

Current Thread