Name

p:text-sort — The standard p:text-sort step.

Synopsis

The p:text-sort step sorts lines in a text document.

Input portPrimarySequenceContent types
source✔  text 
Output portPrimarySequenceContent types
result✔  text 
Option nameTypeValuesDefault value
case-orderxs:string?('upper-first', 'lower-first') ()
collationxs:string? ()
langxs:language? ()
orderxs:string('ascending', 'descending') 'ascending'
sort-keyXPathExpression '.'
stablexs:boolean true()
Declaration
 1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
   |   <p:input port="source"
   |            primary="true"
   |            sequence="false"
 5 |            content-types="text"/>
   |   <p:output port="result"
   |             primary="true"
   |             sequence="false"
   |             content-types="text"/>
10 |   <p:option xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
   |             name="sort-key"
   |             as="xs:string"
   |             select="'.'"
   |             e:type="XPathExpression"/>
15 |   <p:option name="order"
   |             as="xs:string"
   |             select="'ascending'"
   |             values="('ascending', 'descending')"/>
   |   <p:option name="case-order"
20 |             as="xs:string?"
   |             values="('upper-first', 'lower-first')"/>
   |   <p:option name="lang" as="xs:language?"/>
   |   <p:option name="collation" as="xs:string?"/>
   |   <p:option name="stable" as="xs:boolean" select="true()"/>
25 |</p:declare-step>
Errors
CodeDescription
err:XC0098It is a dynamic error (err:XC0098) if a dynamic XPath error occurred while applying sort-key to a line.
err:XC0099It is a dynamic error (err:XC0099) if the result of applying sort-key to a given line results in a sequence with more than one item.
Implementation defined features

Description

The p:text-sort step is defined in the XProc 3.0: Standard Step Library. It is also described on XProcRef.org.