This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28738 - An empty choice is not emptiable
Summary: An empty choice is not emptiable
Status: NEW
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.0/1.1 both
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-02 14:16 UTC by Michael Kay
Modified: 2015-06-02 14:45 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2015-06-02 14:16:44 UTC
It seems that the intended meaning of "emptiable" as applied to a particle is that empty content is a valid instance.

In this sense an empty choice <xs:choice/> is not emptiable, because empty content is not a valid instance (the content must satisfy at least one branch of the choice, and if there are no branches then it cannot do so).

The concept of "emptiable" is used less in 1.1 than in 1.0, but this error still has unfortunate consequences, in particular allowing types to be considered as valid restrictions of an empty choice when they should not be.
Comment 1 Michael Kay 2015-06-02 14:45:48 UTC
While on the subject, the definition of "minimum" in Schema Component Constraint: Effective Total Range (choice) is ambiguous. It can be parsed as

(X) The product of 

(A) P.{min occurs} and 
(B) the minimum of the {min occurs} of every wildcard or element declaration particle in G.{particles} and 
(C) the minimum part of the effective total range of each of the group particles in G.{particles} (or 0 if there are no {particles}).

(In which case it's not clear what B is if there are no particles)

or as

(Y) The product of 

(A) P.{min occurs} and 
(B) (the minimum of 
   (i) the {min occurs} of every wildcard or element declaration particle in G.{particles} and 
   (ii) the minimum part of the effective total range of each of the group particles in G.{particles}) (or 0 if there are no {particles}).

I think that (Y) is intended.