Defines a collection of a single simpleType definition.
<list id = ID itemType = QName {any attributes with non-schema Namespace}…> Content: (annotation?, (simpleType?)) </list>
Optional.
Not allowed if the content contains a simpleType element. Otherwise, required.
Number of occurrences | One time |
Parent elements | simpleType |
Child elements | annotation, simpleType |
When a data type is derived from a list data type, the following constraining facets can be used.
The unit of length is measured in the number of list items. For example, the following example sets the maxLength to 5
, limiting the number of items in an instance of the derivedlistOfIntegers data type to 5 items in this list. Note that restrictions in a list are distinct from restrictions used in other elements.
Lists are always delimited by white space. For example, deriving a list from a simple type of three enumerations such as "books" "magazine articles" "technical newspapers and business journals"
generates a list of eight strings: "books", "magazine", "articles", "technical", "newspapers", "and", "business", "journals"
not a list of three strings.
The following example shows a simpleType that is a list of integers where 5 is the maximum number of items allowed in the list.
<xs:simpleType name='derivedlistOfIntegers'> <xs:restriction base='listOfIntegers'> <xs:maxLength value='5'> </xs:restriction> </xs:simpleType>
The following example shows a simpleType that is a list of integers.
<xs:simpleType name='listOfIntegers'> <xs:list itemType='integer'/> </xs:simpleType>
The following example shows an instance of an element that has an attribute of type listOfIntegers. Each item in the list is of type integer and is separated by white space in this case, a space.
<myelement listOfIntegers='1 100 9 4000 0'>
XML Schema Reference (XSD) | XML Schema Elements
For more information, see the W3C XML Schema Part 2: Datatypes Recommendation at http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#derivation-by-list.