Re: Mutually exclusive elements

Hi Torbjørn,

>>Is it possible to define elements that are mutually exclusive? In
>>the following example I want either <purchase> or <airline> to occur
>>in <transaction> (or none of them).

Use xs:choice:

  <xs:sequence>
    ...
    <xs:choice minOccurs="0">
      <xs:element ref="purchase" />
      <xs:element ref="airline" />
    </xs:choice>
  </xs:sequence>

The above allows either purchase or airline, or neither (since the
choice is optional) but not both.
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Tuesday, 20 November 2001 04:51:25 UTC