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

Re: xs:all with substitutionGroup members

From: Michael Kay <mike@saxonica.com>
Date: Wed, 24 Apr 2019 13:04:29 +0100
Message-Id: <CF5EE1F4-66D6-48E4-988D-4E84EBF3D379@saxonica.com>
Cc: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
To: Pete Cordell <pete++xmlschema-dev@codalogic.com>

> On 24 Apr 2019, at 10:54, Pete Cordell <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
Received on Wednesday, 24 April 2019 12:04:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 24 April 2019 12:04:55 UTC