# Elementname: `SortSequence`

## Description

Sort a list.

Allowed attributes: criterion, numerical, order, removeduplicates, select

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>

# Commands

- A
- Action
- AddSearchpath
- AtPageCreation
- AtPageShipout
- AttachFile
- Attribute
- B
- Barcode
- Bold
- BoldItalic
- Bookmark
- Box
- Br
- Case
- Circle
- Color
- Column
- Columns
- Compatibility
- Contents
- Copy-of
- DefineColor
- DefineFontalias
- DefineFontfamily
- DefineTextformat
- Element
- Fontface
- ForAll
- Frame
- Grid
- Group
- Groupcontents
- HSpace
- Hyphenation
- I
- Image
- Include
- Initial
- InsertPages
- Italic
- Layout
- Li
- LoadDataset
- LoadFontfile
- Loop
- Makeindex
- Margin
- Mark
- Message
- NewPage
- NextFrame
- NextRow
- NoBreak
- Ol
- Options
- Otherwise
- Output
- Overlay
- PDFOptions
- Pageformat
- Pagetype
- Paragraph
- PlaceObject
- Position
- PositioningArea
- PositioningFrame
- ProcessNode
- Record
- Regular
- Rule
- SaveDataset
- SavePages
- SetGrid
- SetVariable
- SortSequence
- Span
- Stylesheet
- Sub
- Sup
- Switch
- Table
- Tablefoot
- Tablehead
- Tablerule
- Td
- Text
- Textblock
- Tr
- Trace
- Transformation
- U
- URL
- Ul
- Until
- VSpace
- Value
- While

Version: 3.2.0 | Start page | Command reference | Other language: German