xsl-list
[Top] [All Lists]

RE: [xsl] Sorting with Different Sort Keys

2007-10-19 02:05:02

I would suggest something like

<xsl:sort select="not(starts-with(lower-case(.), 'seite'))"/>
<xsl:sort select="number(replace(., '[^0-9]', ''))"/>

The not() is because false() sorts before true().

Michael Kay
http://www.saxonica.com/
 

-----Original Message-----
From: Jeff Sese [mailto:jsese(_at_)asiatype(_dot_)com] 
Sent: 19 October 2007 09:32
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Sorting with Different Sort Keys


On 10 19, 07, at 3:51 PM, Abel Braaksma wrote:

Michael Kay wrote:
Start by defining what you want to achieve a little bit more 
precisely.
Where do "Seite 99", "99", "Page 12" and "pink rabbit" fit in your 
desired collating sequence?

Now that we're at it, I'm also wondering... how does "Seite 120",  
"seite 120", "SEITE     120", "Seite 0120", "seite    0012", "    
seite120" and "Seite 12000" fit in (note the extra or 
missing spaces 
and zeroes)?

I would want this kind of ordering:
seite 0012 (sort key value should be 12) Siete 99 (sort key 
value should be 99) Seite 120 (sort key value should be 120) 
seite 120 (sort key value should be 120) SEITE 120 (sort key 
value should be 120) Seite 0120 (sort key value should be 
120) seite120 (sort key value should be 120) Seite 12000 
(sort key value should be 12000)
99 (sort key value should be 99)
Page 12 (sort key value should be '')
pink rabbit (sort key value should be '')

I hope this make things a little bit clear...

-- Jeff

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--