我已经阅读了XSD规范,但仍然感到困惑。空选择在XSD中有效吗?我的意思是,在没有声明任何属性的情况下进行简单选择,必须具有元素“ a”或“ b”,或者它可以为空吗?
<xs:complexType name="ChoiceType">
<xs:choice>
<xs:element name="a" type="type_a"/>
<xs:element name="b" type="type_b"/>
</xs:choice>
</xs:complexType>
在这种情况下可能为空
<xs:complexType name="ChoiceType">
<xs:choice minOccurs="0">
<xs:element name="a" type="type_a"/>
<xs:element name="b" type="type_b"/>
</xs:choice>
</xs:complexType>
反正看到这个问题
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句