2011-06-27 2 views

答えて

3

これはxsdで利用できない機能です。属性を2つのグループに制限する場合は、属性グループごとに1つずつ、2つの要素を定義する必要があります。例:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
    <xs:element name="root"> 
    <xs:complexType> 
     <xs:choice> 
     <xs:element name="MyType1"> 
      <xs:complexType> 
      <xs:attribute name="AAA" type="xs:string" /> 
      <xs:attribute name="DDD" type="xs:string" /> 
      </xs:complexType> 
     </xs:element> 
     <xs:element name="MyType2"> 
      <xs:complexType> 
      <xs:attribute name="BBB" type="xs:string" /> 
      <xs:attribute name="CCC" type="xs:string" /> 
      </xs:complexType> 
     </xs:element> 
     </xs:choice> 
    </xs:complexType> 
    </xs:element> 
</xs:schema> 

希望します。

+0

しかし、これは2つの異なる要素名を与えます。 2つの可能性を持つ1つの名前が欲しい... – Dims

+0

私はあなたが欲しいものを理解しています。私が言っていることは、それがXSDでは不可能だということです。あなたは2つのタイプを定義する必要があります。 –

関連する問題