K
kosaraju.puneeth
I want an element that must have either attribute A or B.
<Thing1 A="aaa"/> <Thing1 B="bbb"/>
I want to enforce this in my schema . If A and B were
elements, I could use choice.
<xs:attribute name="A"/>
<xs:attribute name="B"/>
<xs:element name="Thing1">
<xs:complexType>
<xs:choice >
<xs:element ref="A"/>
<xs:element ref="B"/>
</xs:choice>
</xs:complexType>
</xs:element>
But choice only works for elements, and I am stuck.
Is there a way to do "choice" for attributes?
And if so, how about for attributeGroups too?
Making both attributes optional would accept valid input
but not reject all invalid input. I am hoping for better.
Thanks!
<Thing1 A="aaa"/> <Thing1 B="bbb"/>
I want to enforce this in my schema . If A and B were
elements, I could use choice.
<xs:attribute name="A"/>
<xs:attribute name="B"/>
<xs:element name="Thing1">
<xs:complexType>
<xs:choice >
<xs:element ref="A"/>
<xs:element ref="B"/>
</xs:choice>
</xs:complexType>
</xs:element>
But choice only works for elements, and I am stuck.
Is there a way to do "choice" for attributes?
And if so, how about for attributeGroups too?
Making both attributes optional would accept valid input
but not reject all invalid input. I am hoping for better.
Thanks!