The saxon:order facet for list types
This facet can be used only on list types. If the facet is present, it constrains the values in the list
to be in either ascending or descending order. Adjacent values in the list may be equal unless the
saxon:distinct
facet is also present. Ordering
is defined by the schema ordering rules (which are not the same as the XPath ordering rules: for example the rules
for comparing xs:dateTime
values with and without timezone are different). Each value in the list must
be strictly greater-than-or-equal (in the case of ascending order), or less-than-or-equal (in the case of descending
order) to the previous value in the list. If the values are not comparable, or if their ordering is indeterminate,
then the facet is not satisfied. Strings are ordered using codepoint collation.
The facet may be written as <saxon:order value="ascending"/>
or
<saxon:order value="descending"/>
. The permitted values for the value
attribute are "ascending"
and "descending".
If the facet is present on a type, then it must also be present with the same value on all types derived by restriction.
For example, a list of dates, in ascending order, with no timezone, might be written:
<xs:simpleType name="dates"> <xs:restriction> <xs:list> <xs:simpleType> <xs:restriction base="xs:date"> <xs:explicitTimezone value="prohibited"/> </xs:restriction> </xs:simpleType> </xs:list> <saxon:order value="ascending" xmlns:saxon="http://saxon.sf.net/"/> </xs:restriction> </xs:simpleType>