Name

xs:list — Derivation by list.

Synopsis

<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)

Description

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.

Restrictions

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 ...

Get XML Schema now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.