RE: Restriction+choice+substitutionGroup

(Somehow we ended up off the list, my guess is that there is bug somewhere
in the email chain, "www-xml-schema-comments@w3.org.ficie.nt?" doesn't sound
right.)

Thanks for your help Henry, I will submit the report.  Forgive any naïveté,
but who or what is an SQC? ::)

-----Original Message-----
From: ht@inf.ed.ac.uk [mailto:ht@inf.ed.ac.uk] 
Sent: Thursday, 14 April 2005 5:51 PM
To: Thomson, Martin [WOLL:5500:EXCH]
Cc: www-xml-schema-comments@w3.org.ficie.nt?
Subject: Re: Restriction+choice+substitutionGroup: rcase-RecurseLax insuf


"Martin Thomson" <martin.thomson@nortel.com> writes:

HST wrote:

>> Substitution group heads are treated as if they were choices, so the 
>> change you've made above sets the explicit (X1|X2) against the 
>> implicit (X1|X2|X3), which is fine.  Or am I missing something?
>
> That being the case, maybe there is a bug with the parser that I am 
> using (Xerces 2.6.2).  But I'm not convinced; the standard does not 
> explicitly specify this case under cos-particle-restrict (Schema 
> Component Constraint: Particle Valid (Restriction)),

Yes it does -- see clause 2.1 of Schema Component Constraint: Particle Valid
(Restriction) [1]:

    2.1 Any top-level element declaration particle (in R or B) which
        is the {substitution group affiliation} of one or more other
        element declarations and whose ·substitution group· contains
        at least one element declaration other than itself is treated
        as if it were a choice group whose {min occurs} and {max
        occurs} are those of the particle, and whose {particles}
        consists of one particle with {min occurs} and {max occurs} of
        1 for each of the declarations in its ·substitution group·.

> In addition, the rules under cos-particle-restrict (2.2, then 2.2.2 
> and 2.2.2.2) mean that the inner choice is simplified away.  Leaving 
> the restriction one of elt <- choice, which is expressly prohibited.

Ah, but if _that's_ being applied, and I agree it should be and your second
alternative, which I thought was OK, is a waste of time, but your _first_
one should be OK.

To summarise:

explicit base: (X|Y)*
implicit base: ((X|X1|X2|X3)|(Y|Y1|Y2))*
simplified base: (X|X1|X2|X3|Y|Y1|Y2)*

explicit derived: (X1|X2|Y)*

So it looks OK to me.

I would check with SQC, then file a bug report.

ht

[1] http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict
-- 
 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, 22 April 2005 02:27:54 UTC