xs:list — Derivation by list.
<xs:list id = xs:ID itemType = xs:QName {any attributes with non-schema namespace} > Content: ((xs:annotation?), (xs:simpleType?)) </xs:list>
May be included in: xs:simpleType (local definition), xs:simpleType (global definition)
Derivation by list is the process of transforming a simple datatype (named the item type) into a whitespace-separated list of values from this datatype.
The item type can be defined inline by adding a
simpleType
definition as a child element of the
list element, or by reference, using the itemType
attribute (it is an error to use both).
The semantic and list of facets applicable on the item type are lost
and the new datatype inherits a list of facets, which is common to
all the list datatypes: xs:enumeration
,
xs:length
, xs:maxLength
,
xs:minLength
, and xs:pattern
and its whitespaces are always collapsed.
After a derivation by list, the type of the resulting datatype is a list of whatever the item type was (atomic or union).
It is possible to define lists of atomic datatypes that allow
whitespaces such as xs:string
. In this case, the
whitespaces are always considered separators.
The facets that can be applied to a list datatype are common to all the list datatypes, and add constraints to the list as a whole (rather than on the items composing the list). The constraints on the item composing the lists, therefore, need to be applied before the derivation by list.
The list separators cannot be chosen and are always whitespaces.
It is explicitly forbidden by the Recommendation to define lists of lists. Lists of unions and unions of lists are both allowed, so it should be possible to work around this limitation by defining a dummy union of a list and using this union as a list item if needed. However, lists of lists are effectively pointless, since all the list types have the same set of separators.