I\'m trying to take XML data and sort elements by their data attribute. Unfortunately the dates come over in mm/dd/yyyy format and are not static lengths. (Jan = 1 instead of
Here is one way to do this sorting using a 2-pass transformation (it is possible to do this in a one-pass transformation, but the code would be too-complicated):
when this transformation is applied on the provided XML document:
the wanted, correct result is produced:
Do note:
Multipass transformations in XSLT 1.0 require the use of the vendor-specific xxx:node-set()
function to convert the result of a pass from its RTF (Result Transformation Fragment) type to a regular tree (document).
The xxx:node-set()
function used in this solution is the ext:node-set()
function of EXSLT, which is implemented on most XSLT processors.