W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2000

Re: XML Schema: How to get "Inclusive OR" instead of "Exclusive OR"

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 24 Oct 2000 18:53:16 +0100
To: paul@pnlassociates.com
Cc: "Linda M. Phillips" <linda@pnlassociates.com>, xmlschema-dev@w3.org
Message-ID: <f5bk8ayp1mb.fsf@cogsci.ed.ac.uk>
"Paul B. Anderson" <paul@pnlassociates.com> writes:

> Henry,
> 
> Thanks for your prompt reply.  If I understand correctly, <all> allows the
> child elements to appear or not appear, and in any order.  It also seems to
> allow the case of none of the elements.  If so, this does not accomplish our
> goal of A inclusive-or B since at least one is not guaranteed to appear.

Right, sorry.

The best you can do is the same as with DTDs:

 (ab?|ba?) ==

 <choice>
  <sequence>
   <element ref="a"/>
   <element ref="b" minOccurs="0"/>
  </sequence>
  <sequence>
   <element ref="b"/>
   <element ref="a" minOccurs="0"/>
  </sequence>

ht   
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Tuesday, 24 October 2000 13:53:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:47 UTC