我们可以在xsd中选择不同的属性组吗?

时间:2017-02-02 07:12:16

标签: xsd

我们可以做以下事吗?如果没有,您可以指导我在xsd中选择属性组。

<xsd:complexType name="getGroupType">
    <xsd:choice minOccurs="1" maxOccurs="1">
            <xsd:attributeGroup ref="groupA"/>
            <xsd:attributeGroup ref="groupB"/>
    </xsd:choice>
</xsd:complexType>

1 个答案:

答案 0 :(得分:0)

xsd:choice被称为模型组,只能与元素一起使用,而不能与属性一起使用。但是,可以使用子类型(扩展基类的两种类型)模拟属性组的选择。