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 2554 - Should UPA be a model group or particle constraint?
Summary: Should UPA be a model group or particle constraint?
Status: CLOSED INVALID
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.0/1.1 both
Hardware: All All
: P4 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard: important, easy
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2005-11-28 02:36 UTC by Sandy Gao
Modified: 2009-04-21 19:21 UTC (History)
0 users

See Also:


Attachments

Description Sandy Gao 2005-11-28 02:36:38 UTC
Currently UPA is in 3.8.6 to constraint model groups. Consider the following:

<complexType>
  <sequence maxOccurs="2">
    <element name="a"/>
    <element name="a" minOccurs="0"/>
  </sequence>
</complexType>

This should be invalid, because for the input <a/><a/>, we don't know which 
element declaration to use for the second <a/>.

The content type of this complex type is a particle, whose term is a model 
gruop (the only model group in the content type). This model group is a 
sequence of 2 element declarations.

It's clear that the sequence model group itself doesn't violate UPA, then how 
do we flag this complex type as invalid? Shouldn't UPA be defined on particles?
Comment 1 C. M. Sperberg-McQueen 2006-09-24 15:00:42 UTC
Strictly speaking, the Unique Particle Attribution constraint is described
(both in 1.0 and in the status quo of 1.1) as applying to a 'content model',
rather than a 'model group'.  The term 'content model' is defined in 
section 2.2.3.2 as a particle:

    A particle can be used in a complex type definition to constrain the 
    &#183;validation&#183; of the [children] of an element information item; such 
    a particle is called a content model.

In the example, the constraint applies to the particle whose term is the
sequence, not to the sequence group itself.  So the repetition information
which is essential to detecting the problem is not lost.

Does this sufficiently address the problem, or am I missing something?
Comment 2 Sandy Gao 2006-09-27 03:02:43 UTC
The analysis in comment #1 looks correct. I'm marking this bug as invalid.

I obviously must have assumed the first 3 words of UPA to be "a model group" as opposed to "a content model". The confusion is probably caused by the fact that the constraint is in section "3.8.6 Model Groups".