- From: Jeni Tennison <jeni@jenitennison.com>
- Date: Tue, 20 Nov 2001 09:51:22 +0000
- To: Torbjørn Pehrsen <torbjorn.pehrsen@europay.no>
- CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
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