<Performance>
<grouping usingTarget="M/R" />
<state code="test"/>
<state code="test2"/>
</Performance>
如何为以下内容编写XML模式,以便只能指定一个(必需的)grouping
标记,但是,可以指定无限(或零)state
标记?
目前我有这个允许其他分组标签。
<xsi:complexType name="PerformanceType">
<xsi:choice minOccurs="1" maxOccurs="unbounded">
<xsi:element ref="grouping" minOccurs="1" maxOccurs="1" />
<xsi:element ref="client" />
</xsi:choice>
</xsi:complexType>
答案 0 :(得分:0)
<xs:complexType name="PerformanceType">
<xs:sequence>
<xs:element ref="grouping" minOccurs="1" maxOccurs="1" />
<xs:element ref="state" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>