|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Sorting by days of the week
Hi,
> I need to sort my output by days of the week. i.e. I have a
> element called
> 'dayCode' which can contain one of the following values:
> MON1, MON2, TUE1,
> TUE2, WED1, WED2, THU1, THU2, FRI1, FRI2 etc etc
>
> I've tried using <xsl:sort select="dayCode"
> order="ascending"/> but as you
> would expect, the output order is FRI, MON, THU, TUE, WED.
>
> Is there a way to do this kind or sort??
<xsl:sort select="string-length(substring-before('MONTUEWEDTHUFRISATSUN', translate(dayCode, '0123456789', '')))" data-type="number"/>
<xsl:sort select="translate(dayCode, translate(dayCode, '0123456789', ''), '')" data-type="number"/>
Cheers,
Jarno - Revolution By Night: Faithless (Pandora) (by Assemblage 23)
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








