<xsd:complexType>
<xsd:sequence>
<xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
在上面的示例中,我只有一个元素(称为allowFieldTruncation
)在复杂类型下定义,并且对minOccurs
或maxOccurs]没有要求。现在我的问题是为什么我应该包含一个序列标签–定义不能像下面吗?
<xsd:complexType>
<xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
</xsd:complexType>
<complexType
abstract = boolean : false
block = (#all | List of (extension | restriction))
final = (#all | List of (extension | restriction))
id = ID
mixed = boolean : false
name = NCName
{any attributes with non-schema namespace . . .}>
Content: (annotation?,
(simpleContent | complexContent
| ((group | all | choice | sequence)?,
((attribute | attributeGroup)*, anyAttribute?))))
</complexType>