to the main page about the tutorial  THE XML REVOLUTION  -  TECHNOLOGIES FOR THE FUTURE WEB back up next

Sorting

Sorting chooses an order for xsl:apply-templates and xsl:for-each (default: document order): Some extra attributes:

Example:
<xsl:template match="personlist">
  <xsl:apply-templates select="person">
    <xsl:sort select="name/family"/>
    <xsl:sort select="name/given"/>
  </xsl:apply-templates>
</xsl:template>

This template rule processes a list of persons, sorted with family name as primary key and given name as secondary key.

back COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH next