Version 5.7.12

# `SortSequence`

Sort a list.

## Child elements

(none)

## Parent elements

`AtPageCreation`, `AtPageShipout`, `Case`, `Contents`, `Element`, `ForAll`, `Loop`, `Otherwise`, `Record`, `SaveDataset`, `SavePages`, `SetVariable`, `Until`, `While`

## Attributes

`criterion` (text)
  Name of the attribute that is used as the sort key.
`numerical` (optional, since version 3.1.21)
  Sort alphabetical or numerical
  - `yes`: Sort alphabetical
  - `no`: Sort alphabetical (default)
`order` (optional, since version 3.1.22)
  Select the sorting order
  - `ascending`: Use ascending sort order (default)
  - `descending`: Use descending sort order
`removeduplicates` (text, optional)
  If this attribute is used then it contains the name of the data-attribute that gets evaluated when duplicates are eliminated.
`select` (XPath expression)
  The data that should be sorted.

## Example

Data:

    <data>
      <elt value="one"/>
      <elt value="two"/>
      <elt value="three"/>
    </data>

Layout:

    <Record element="data">
      <SetVariable variable="unsorted" select="*"/>
      <SetVariable variable="sorted">
        <SortSequence select="$unsorted" criterion="value"/>
      </SetVariable>
      <PlaceObject>
        <Textblock>
          <ForAll select="$sorted">
            <Paragraph><Value select="@value"></Value></Paragraph>
          </ForAll>
        </Textblock>
      </PlaceObject>
    </Record>

#### On this page