Sorting in XSLT
This is an open discussion with 2 replies, filed under XSLT.
Search
Figured it out. Here's an example:
First, <xsl:sort select="title" ...
Then, use <xsl:sort select="substring-before(time, ':')" ...
for hours and then <xsl:sort select="substring-after(time, ':')" ...
for minutes. Don't forget to order
them and use number
as data-type
.
Until you realise you may also want to group the entries, in which case I may introduce you to Muenchian Grouping
Create an account or sign in to comment.
I have been trying to do sorting by two values. First is text type and it works, but I need to sort also by time. How I could achieve this?
For example, if I have entries that I sort by title: C, B, B, B, B, A, and then by time. The order by title should stay same, but with entries titles starting with B (or others too) shoud be ordered by time.
Like: A, B (13:00), B (14:00), ...