XML technologies / XSLT / Introduction to XSLT 2.0 / XSLT and XPath – round two / Sorting with xsl:sort

(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 2.)

Once a sequence has been assembled, it is normally processed in its existing order, as it stands, unless further action is taken. This often corresponds to document order, which is frequently not particularly relevant. An order based on the content of the data to be output would be much more useful. In other words, sorting should be possible.

For this purpose, XSLT 2.0 provides the instruction xsl:sort, which directly sorts a sequence.

   

   

back to top