XML Schema 参考手册 完整 XML Schema 参考手册 The list element defines a collection of individual simpleType definitions. 父元素: SimpleType (? Symbol declaration an element can appear zero or once in a list element. ) Attribute Description Id Optional. Specifies the unique ID of the element. ItemType The name of the built-in data type or simpleType element defined in this schema (or other schema indicated by the specified namespace). The simpleType element that contains the list element is derived from the simple type specified by the list value. The list value must be a qualified name (QName). This attribute is not allowed if the content contains a simpleType element, otherwise it is required. Any attributes Optional. Specifies any other attributes with the non-schema namespace. The following example shows a simple type that is a column of integers: 注意: Spaces are used as delimiters for list items. The following example shows a simple type for a column of strings:Definition and usage ¶
Element information ¶
Grammar ¶
<list
id=ID
itemType=QName
*any attributes*
>
(annotation?,(simpleType?))
</list>
Example 1 ¶
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="intvalues" type="valuelist">
<xs:simpleType name="valuelist">
<xs:list itemType="xs:integer"/>
</xs:simpleType>
</xs:schema>
文档中的 "intvalues" 元素类似这样(注意这个列表有五个列表项):
<intvalues>100 34 56 -23 1567</intvalues>
Example 2 ¶
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="stringvalues" type="valuelist">
<xs:simpleType name="valuelist">
<xs:list itemType="xs:string"/>
</xs:simpleType>
</xs:schema>
文档中的 "stringvalues" 元素类似这样(注意这个列表有四个列表项):
<stringvalues>I love XML Schema</stringvalues>