Substring Function format
substring(value, start, length)
Characters within a string are numbered 1, 2, 3 ... n. Michael Kay
XSLT Programmers Reference
Let's look at a few examples:
First lets look at a date in the format mm/dd/yyyy
The first sort element singles out the yyyy and sorts on that first.
The second sort element singles out the mm and sorts on that.
The third sort element singles out the dd and sorts on that
Different date formats are just as simple. Different formats just require adjusting the substring functios
One interesting sidenote if you want to do something with the sorted nodes after they are sorted i.e. position() use the apply-templates rather than for-each
|