[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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>
xml schema choice empty

"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

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.