允许组中的元素以任意顺序显示(或不显示)在包含元素中。
<all
id = ID
maxOccurs= 1: 1
minOccurs= (0 | 1): 1
{any attributes with non-schema Namespace...}>
Content: (annotation?, element*)
</all>
特性
id
该元素的 ID。 id 值必须属于类型 ID 并且在包含该元素的文档中是唯一的。可选。
maxOccurs
元素可出现的最大次数。 该值必须是 1。可选。
minOccurs
元素可出现的最小次数。 该值可以是整数 1。 若要指定该元素是可选的,请将此特性设置为零。 默认值为 1。可选。
元素信息
出现次数 |
一次 |
父元素 |
group、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent)、complexType |
内容 |
示例
下面的示例定义一个复杂数据类型,包含 all 元素以及下面示例的 XML 实例文档的三个元素:
<?xml version="1.0"?>
<myElement myAttribute="1.1">
<thing2>Some</thing2>
<thing3>text</thing3>
<thing1>for you</thing1>
</myElement>
其他资源
有关更多信息,请参见“W3C XML Schema Part 1: Structures Recommendation”(W3C XML 架构第 1 部分:结构建议),网址为:www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-all。