W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2019

Re: xs:all with substitutionGroup members

From: Pete Cordell <pete++xmlschema-dev@codalogic.com>
Date: Wed, 24 Apr 2019 13:40:09 +0100
To: Michael Kay <mike@saxonica.com>
Cc: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <fc363597-e0f9-2b1f-8b25-86d2310fa52a@codalogic.com>
Thanks Michael.

Pete.
-- 
---------------------------------------------------------------------
Pete Cordell
Codalogic Ltd
Read & write XML in C++, http://www.xml2cpp.com
---------------------------------------------------------------------

On 24/04/2019 13:04, Michael Kay wrote:
> 
> 
>> On 24 Apr 2019, at 10:54, Pete Cordell 
>> <pete++xmlschema-dev@codalogic.com 
>> <mailto:pete++xmlschema-dev@codalogic.com>> wrote:
>>
>> Hi All,
>>
>> In XSD 1.0, can an xs:all model group contain a particle that refers 
>> to a substitution group?
> 
> Yes, it can.
>>
>> In my head I see substitution groups as an alternative way of building 
>> xs:choice like constructs.  As xs:all only allows Content of 
>> (annotation?, element*), by my rule, an element that refers to a 
>> substitution Group wouldn't be permitted.
>>
>> Is this the case?  If so, (for bonus marks) where does the spec say?
> 
> Well, it doesn't say it can't, therefore it can.
> 
> More specifically, §3.8.4 says
> 
> 3 *If *the {compositor} 
> <https://www.w3.org/TR/xmlschema-1/#compositor> is /all/, *then *there 
> must be a ·partition· 
> <https://www.w3.org/TR/xmlschema-1/#key-partition> of the sequence into 
> |n| sub-sequences where |n| is the length of {particles} 
> <https://www.w3.org/TR/xmlschema-1/#particles> such that there is a 
> one-to-one mapping between the sub-sequences and the {particles} 
> <https://www.w3.org/TR/xmlschema-1/#particles> where each sub-sequence 
> is ·valid· <https://www.w3.org/TR/xmlschema-1/#key-vn> with respect to 
> the corresponding particle as defined in Element Sequence Locally Valid 
> (Particle) (§3.9.4) <https://www.w3.org/TR/xmlschema-1/#cvc-particle>.
> 
> and §3.9.4 clause 2.3.3 allows members of the substitution group to 
> match an element particle.
> 
> Michael Kay
> Saxonica
Received on Wednesday, 24 April 2019 12:40:35 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 24 April 2019 12:40:36 UTC