No, XSD does not support this.
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<> wrote in message
news: oups.com...
>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!
>