[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Sorting with Different Sort Keys

Subject: Re: Sorting with Different Sort Keys
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 19 Oct 2007 11:26:23 +0200
Re:  Sorting with Different Sort Keys
Abel Braaksma wrote:

<xsl:sort select="matches(., '\s*seite', 'i')" order="descending" />
<xsl:sort select="not(matches(., '^\d+$'))" order="ascending" />
<xsl:sort select="replace(., '\D', '')" order="ascending" data-type="number" />



note that technically the last line is semantically equivalent with the last line posted by Michael (and my order="ascending" is redundant):


<xsl:sort select="number(replace(., '[^0-9]', ''))"/>

also note that my first line contains an error and that its meaning is slightly different from the one posted by Michael, namely allowing for leading whitespace, here's the fixed version:


<xsl:sort select="matches(., '^\s*seite', 'i')" order="descending" />

then, to finalize this little analysis: my middle line allows for all non-correct items to be put at the end in document order, even if they do contain a number, which could be rewritten (matter of taste) like this:

<xsl:sort select="matches(., '^\d+$')" order="descending" />


-- Abel


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.