Sorts XML nodes from a source using a sort key defined by an XPath.

The Sort step works as follows:

• It defines an input list to work on using a source, i.e. a list of nodes to be sorted from a previous step.
• It applies a common XPath on each item of the list to define a sort key for this node. The XPath is defined in the Sort key XPath property. The result of this XPath applied on each item of the list is the sort key. This sort key is the value that can actually be sorted (by number, by alphabetical order, etc.) and used to sort the matching nodes.
• It uses the sort keys to sort the nodes of the list, using options defined in other properties (Sort order, Sort type and Sort options).
• It finally outputs the sorted nodes, so they can be used as source by a following step or output by the Sequence.

Property Type Category Description
Comment String standard Describes the object comment to include in the documentation report.
This property generally contains an explanation about the object.
Is active boolean standard Defines whether the step is active.
Output boolean expert Defines whether the XML generated by this step should be appended to the resulting XML.
Set this property to true to add the step’s resulting XML to the sequence’s output XML (default value for steps generating XML). Set this property to false to prevent the steps’s XML result to appear in the sequence’s output XML.
Setting this property to false does not prevent the step’s generated XML from being used as a source by other steps.
Sort key XPath String expert The XPath that is applied on each node of the list to define its sort key.
This property allows to define the XPath that will be applied on each node of the source list to give the sort key of the node. The sort key of each node of the list is then used for sorting the list: each node is represented by its sort key during the sort algorithm.
Sort option JS expression expert Defines some options to sort the sort key, depending on their type.
Depending on the Sort type property value, this property contains options that are needed to make the comparison. For Date sort type (sort keys of date type), this property must contain the sort keys date format. For more information on usable symbols, see Appendix “Date format - Usable symbols”.
Sort order Order expert Defines the sorting order.
This property allows to define the sorting order. It can take the following values:

Ascending: the sort is performed by ascending order,
Descending: the sort is performed by descending order.
Sort type TypeOrder expert Defines on which data type the sort is performed.
This property allows to define on which data type the sort is performed. It can take the following values:

String: the sort keys are of string type, the sort is performed by alphabetical order,
Number: the sort keys are of number type, the sort is performed by numerical order,
Date: the sort keys are of date type, the sort is performed chronologically, using the Sort option property to define the date format.
Source XMLVector expert Defines the list of nodes to sort using a source.
This property allows defining a list of nodes from a previous step on which current step works, i.e. the items to sort.
A source is defined as a reference on a step previously existing in the parent sequence, associated with an XPath applied on the step’s result DOM. At runtime, the XPath is applied on the step’s current execution result XML and extracts a list of XML nodes resulting from this execution.
If the XPath doesn’t match or if the source is left blank, the step has no data to work on: the list of objects to sort is empty, nothing is sorted and the parent sequence execution continues.