要求组中的元素以指定的顺序显示在包含元素中。
<sequence
id = ID
maxOccurs = (nonNegativeInteger | unbounded) : 1
minOccurs = nonNegativeInteger : 1
{any attributes with non-schema Namespace}...>
Content: (annotation?, (element | group | choice | sequence | any)*)
</sequence>
特性
id
该元素的 ID。 id 值必须属于类型 ID 并且在包含该元素的文档中是唯一的。可选。
maxOccurs
序列可出现的最大次数。 该值可以是大于或等于零的整数。 若不想对最大次数设置任何限制,请使用字符串“unbounded”。可选。
minOccurs
序列可出现的最小次数。 该值可以是大于或等于零的整数。 若要指定该序列组是可选的,请将此属性设置为零。可选。
元素信息
出现次数 |
在组内为一次;否则为无限制。 |
父元素 |
group、choice、sequence、complexType、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent) |
内容 |
annotation、any、choice、element、group、sequence |
示例
以下示例说明一个元素 (zooAnimals) 在 sequence 元素中可以包含下列元素的零个或多个:elephant、bear、giraffe。
其他资源
有关更多信息,请参见“W3C XML Schema Part 1: Structures Recommendation”(W3C XML 架构第 1 部分:结构建议),网址为:www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-all。