c:sort

<c:sort
  by? = lambda_expression
  order? = { "ascending" | "descending" } />

Defines how to sort sequences of items.

Permitted parent elements
c:for-each
c:for-each-group

Attributes

by A lambda expression that computes the sorting key.
order Specifies the sort direction ("ascending" or "descending").

In addition to the attributes in the preceding table, there are a number of standard attributes that may appear on any XCST element.

Remarks

When used within c:for-each, c:sort defines the order used to process items. When used within c:for-each-group, c:sort defines the order used to process groups, and does not affect the order of items within each group.

Example: Using c:sort in c:for-each
<c:for-each name='address' in='addressBook'>
  <c:sort by='a => a.last_used' order='descending'/>

  <address>
     ...
  </address>
</c:for-each>