A set of tests on changes to substition-group behavior, constructed by hand, as a contribution to the XML Schema 1.1 test suite.

Revisions:

  • 2010-06-17 : CMSMcQ : add test groups sg-abstract-upa etc. for checking the changes defining abstract elements as members of substitution groups.
  • 2010-06-16 : CMSMcQ : correct error in test of content model competition: the negative wildcard does compete with n, but the element wins (UPA has been weakened in 1.1).
  • 2010-06-16 : CMSMcQ : move this catalog into the dev.w3.org directory structure in directory wgMeta. Change locations of DTD, stylesheet, etc. accordingly.
  • 2010-06-10 : CMSMcQ : create this test catalog, using XHTML modularization driver.

In section G.1.3 Changes to content models, XSD 1.1 says (in list item 3):

Finally, the keyword ##definedSibling can be used to exclude all elements explicitly mentioned in a content model (and all elements substitutable for those elements).

So we test the following interactions of definedSibling and substitution groups, in schemas with some subset of elements e, s, n, s1, n1, s2, n2, with s1 substitutable ('s') for s, and s2 for s1, but n1 and n2 not substitutable for n (or anything else). Elements n and s are siblings, together with a negative wildcard (no positive wildcard is possible) which has the keyword #definedSibling.

  1. A negative wildcard excludes s1 but not n1.
  2. A negative wildcard competes with n but not s, but the result is the same in either case, since when elements and wildcards compete, the element wins.

In this test set, we exercise the fact that a negative wildcard excludes s1 but not n1.

Negative wildcard excludes s1 but not n1. (Second time around).

A negative wildcard competes with n, but not s.

But elements outrank wildcards, so there's no conflict in either case.

This test defines a content model beginning with s, n and continuing with any of (negative-wildcard, a), (s, b), or (n, c). The instance tests have element sequences beginning with s and n, continuing with one of s1, n1, e, and ending with one of a, b, c. The sequences with s1 test the processor's handling of the competition between s1 and the negative wildcard. The other tests are present primarily for symmetry.

In section G.1.9 Element declarations, XSD 1.1 says (in list item 3):

Abstract elements may now appear in substitution groups.

This change was adopted to resolve bug 4337 Substitution group and abstract, which pointed out some uncertainty about whether particular content models did or did not violate the UPA and EDC constraints.

Because no element in a document instance is locally valid against an abstract element declaration, this change does not mean that abstract elements can now be instantiated in a valid instance document. Instead, the effect is to make clear that abstract element declarations are considered when deciding whether a content model violates constraints defined in terms of elements' substitution groups.

This test group illustrates the violation of the Unique Particle Attribution constraint by a competition between a local element declaration and an abstract global element declaration which is substitutable for another.

For context see test group sg-abstract-upa above.

Like sg-abstract-upa, this test group illustrates the violation of the Unique Particle Attribution constraint by a competition between a local element declaration and an abstract global element declaration which is substitutable for another.

In this case, however, the top-level e1 and the local e1 have different types. If a 1.0 processor ignores the global e1 on the grounds that it's not a member of the actual substitution group of e, then it will accept this schema, and validate the instances as shown. A 1.1 processor must reject the schema; it violates both UPA and EDC.

For context see test group sg-abstract-upa above.

The schema in this test group illustrates the violation of the Element Declarations Consistent constraint by an abstract top-level element. XSD 1.0 processors which treat abstract elements as not part of any actual substitution group will accept the schema and validate the instances accordingly.

XSD 1.1 processors must reject the schema.