W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

Re: Original Choice (was RE: Choice)

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 14 Mar 2002 17:23:59 +0000
To: "Beyer,Nathan" <NBEYER@cerner.com>
Cc: "Schema Dev XML (E-mail)" <xmlschema-dev@w3.org>
Message-ID: <f5bzo1b83m8.fsf@cogsci.ed.ac.uk>
"Beyer,Nathan" <NBEYER@cerner.com> writes:

> below...
> -----Original Message-----
> From: ht@cogsci.ed.ac.uk [mailto:ht@cogsci.ed.ac.uk]
> > The second says
> > choose (any number of times) between a required c1 or a required c2
> >So you're allowed nothing, or c1, or c2, or c1c1, or c1c2, or c2c1,
> >  or c2c2, or . . .
> The piece that's confusing is that c1 and c2 are required elements, yet I
> could just have c1 and it would validate. Isn't c2 required? The way you
> interpreted seems like you're just ignoring the occurs attributes of the
> particles within the choice

minOccurs='0' really does mean "0 or more".  The choice takes precedent
over what_ever_ is inside.  Read "each time you make the choice, you
are _required_ to chose between c1 and c2 -- but you can chose to make
the choice 0 times.

> >Perhaps converting to DTD notation would help?
> > The first is (c1?|c2?)
> > The second is (c1|c2)*
> > Your earlier example was (c1*|c2*)
> I'm not extremely fluent in DTDs, but does (c1|c2)* allow for nothing? I
> thought that was c1 or c2, one to many times.

(c1|c2)* allows for nothing. (c1|c2)+ (== minOccurs='1') requires at
least one.

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, 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/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Thursday, 14 March 2002 12:24:01 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC