W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2005

Re: Empty choice in a group ?

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Fri, 07 Jan 2005 17:48:05 +0000
To: "Bruno Chatel" <bcha@chadocs.net>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5bk6qpxh9m.fsf@erasmus.inf.ed.ac.uk>

"Bruno Chatel" <bcha@chadocs.net> writes:

> Is the following  allowed :
>
> <xs:group name="empty.Grp">
>   <xs:choice/>
>  </xs:group>

Yes.

> But msxml detect an error :

> empty.xsd#/schema[1]/group[position() = 1 and @name =
> 'empty.Grp']/choice[1] Empty can be satisfied only if {minOccurs =
> 0}.
>
> What is the correct answer ? 

MSXML's comment is correct -- such a group can never be satisfied.

*But* it's not an error in the schema (document) to have such an
unsatisfiable group, so _if_ MSXML is refusing to use it, _that's_ a
bug.

If on the other hand it's offering that comment when you try to
validate an element whose type definition consists of that group, then
that's just a helpful comment as to why your instance is being
rejected, and there is no bug.

The analogy I usually offer is with boolean algebra -- AND with no
arguments is true, but OR with no arguments is false.

ht
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.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 Friday, 7 January 2005 17:48:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:49 GMT