2016-04-11 9 views
1

xs:attributeGroup要素のXSDスキーマがあります。XSD:属性に制限を追加するにはどうすればよいですか?

<xs:attributeGroup name="userAttrGroup"> 
    <xs:attribute name="age"   type="xs:integer" use="required"/> 

    <!-- Should be at least one of {status | address-type | country} --> 

    <xs:attribute name="status"  type="xs:string" use="optional"/> 
    <xs:attribute name="country"  type="xs:string" use="optional"/> 
    <xs:attribute name="address-type" type="xs:string" use="optional"/>  
</xs:attributeGroup> 

3つの属性に制限を加えたいとします。それは次のセットの少なくとも1つである必要があります{status, address-type, country}

XSDでこれを行うことはできますか?

答えて

0

XSD 1.1では、アサーションを使用してその種類の状況依存制約を表すことができます。 XSD 1.0では、あなたがしたいことをする方法を知らない。

関連する問題