0
<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>
4

1 回答 1

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>
于 2012-10-15T07:41:23.140 回答