1
我有一個複雜的類型定義,它當前不包含任何minOccurs限制。當我使用這個comlpex類型作爲一個元素類型時,我有時候希望這些元素具有minOccurs 0,其他時間1。XSD Make minOccurs取決於包含的類型
<xsd:complexType name="Identifier">
<xsd:sequence>
<xsd:element name="Id" type="xsd:string"/>
<xsd:element name="Version" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Wibble">
<xsd:sequence>
<xsd:element name="Id" type="Identifier"/> <!-- I want all elements of Identifier to be mandatory when used as part of a 'Wibble' -->
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Wobble">
<xsd:sequence>
<xsd:element name="Id" type="Identifier"/> <!-- I want all elements of Identifier to be optional when used as part of a 'Wobble' -->
</xsd:sequence>
</xsd:complexType>
這可能嗎?
在此先感謝。
今天我正在學習愛羣體!乾杯 – ng5000 2009-10-16 15:13:31