The presentation of this document has been augmented to identify changes from a previous version. Three kinds of changes are highlighted: new, added text,changed text, anddeleted text.


W3C

Draft proposed Phase-1 Wording for Weak Wildcards

1 November 2004

Editor:
Henry S. Thompson

Status of this Document

First draft

Table of Contents

1 Introduction
2 Changes to Constraints on Components
3 Changes to Validation Rules


1 Introduction

Making wildcards 'weaker' than explicit declarations removes much of the perceived negative impact of UPA, considerably increasing their utility wrt versioning

Fortunately implementing the change to wildcard semantics can be done gracefully at the level of abstraction already adopted in 1.0, while at the same time giving a more explicit definition of (what remains of) UPA than was done in 1.0.

2 Changes to Constraints on Components

Schema Component Constraint: Unique Particle Attribution

Editorial Note: The following definitions are moved from their former home in Element Sequence Valid

[Definition:]  Define a partition of a sequence as a sequence of sub-sequences, some or all of which may be empty, such that concatenating all the sub-sequences yields the original sequence.

[Definition:]  Define the set of component sequences assigned to a sequence of element information items by a [weak] model group as follows: the appropriate case among the following:

1 If the {compositor} is sequence, then there must be aFor every ·partition· of the sequence into n sub-sequences where n is the length of {particles} such that each of the sub-sequences in order is ·valid· with respect to the corresponding particle in the {particles} as defined in (§), the sequence of ·context-determined components· as determined for each member of the item sequence by (§) is a member of the ·set of component sequences assigned· to the item sequence by the group.
2 If the {compositor} is choice, then there must be a For every particle among the {particles} such that the sequence is ·valid· with respect to that particle as defined in (§), the sequence of ·context-determined components· as determined for each member of the item sequence by (§) is a member of the ·set of component sequences assigned· to the item sequence by the group.
3 If the {compositor} is all, then there must be aFor every ·partition· of the sequence into n sub-sequences where n is the length of {particles} such that there is a one-to-one mapping between the sub-sequences and the {particles} where each sub-sequence is ·valid· with respect to the corresponding particle as defined in (§), the sequence of ·context-determined components· as determined for each member of the item sequence by (§) is a member of the ·set of component sequences assigned· to the item sequence by the group.

A content model must be formed such that during ·validation· of an element information item sequence, the particle component contained directly, indirectly or ·implicitly· therein with which to attempt to ·validate· each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.

For every sequence of element information items which is locally ·valid· with respect to a model group, as defined by Element Sequence Valid (§3), there is ·set of component sequences assigned· to the item sequence. The members of this set must not differ except in one limited way. For each position in the sequences, one of the following must be true:
1 They all have the identical component at that position, that is, the set of components at that position across all the sequences must consist of exactly one component (an Element Declaration or a Wildcard).
2 They all have either a particular Element Declaration or a particular Wildcard at that position, that is, the set of components at that position across all the sequences must consist of exactly two components, one Element Declaration and one Wildcard.
Note: This constraint reconstructs for XML Schema the equivalent constraints of [ref-xml] and SGML. Given the presence of element substitution groups and wildcards, the concise expression of this constraint is difficult,This definition in terms of the non-deterministic definition of component assignment will not be directly usable by most implementations -- see (§) for further discussion.

Since this constraint is expressed at the component level, it applies to content models whose origins (e.g. via type derivation and references to named model groups) are no longer evident. So particles at different points in the content model are always distinct from one another, even if they originated from the same named model group.

3 Changes to Validation Rules

Validation Rule: Element Sequence Valid
For a sequence (possibly empty) of element information items to be locally ·valid· with respect to a [strong] model group, the ·set of component sequences assigned· to the item sequence by the group, call it CDCS, must be non-empty.

When this constraint is satisfied, the model group determines a unique sequence of ·context-determined components· for the item sequence, as follows: The appropriate case among the following:

1 If CDCS has exactly one member, then that is the required unique sequence of ·context-determined components·
2 otherwise Unique Particle Attribution (§2) guarantees that at each position in the sequences of components in CDCS one of the following must be true:
2.1 All the sequences will have the identical Element Declaration.
2.2 All the sequences will have the identical Wildcard.
2.3 There will be a unique Element Declaration which some sequences have, and a unique Wildcard which all the others have.
The membership of the required unique sequence of ·context-determined components· then consists, at each position, of the only available component in the first two cases, and of the unique Element Declaration in the third.
Note: The last part of the above definition ensures that when a content model might allow either a wildcard or an explicit declaration to match an item, the explicit declaration is preferred.

Nothing in the above should be understood as ruling out groups whose {particles} is empty: although no sequence can be ·valid· with respect to such a group whose {compositor} is choice, the empty sequence is ·valid· with respect to empty groups whose {compositor} is sequence or all.