W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2007

[Bug 3954] Indirect circularity of union and restriction should be banned

From: <bugzilla@wiggum.w3.org>
Date: Wed, 26 Sep 2007 01:33:50 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1IaLmg-0007Jc-PC@wiggum.w3.org>


cmsmcq@w3.org changed:

           What    |Removed                     |Added
             Status|NEW                         |ASSIGNED
           Keywords|                            |needsAgreement

------- Comment #1 from cmsmcq@w3.org  2007-09-26 01:33 -------
This ties in with bug 3235, which asks where the rule forbidding
circularity of unions is actually imposed.  (Short answer: for now,
only in Structures -- the relevant parts of the two specs do not seem
to be fully aligned.)

I agree that the example (in which a union has a member type derived from 
the union by restriction) should be illegal, and clearly so, both when
Structures is used and when it is not.

The rule against cycles is currently formulated twice: once as clause
5 of Simple Type Definition Representation OK

    5 There are no circular union type definitions. That is, if the
      <union> alternative is chosen, there are no entries in the
      memberTypes [attribute] which ˇresolveˇ to simple types with
      {variety} union which include among their transitive membership
      the component corresponding to the <simpleType>.

and once as clause 3.2 of Derivation Valid (Restriction, Simple)

    3.2 Neither the Simple Type Definition nor a type derived from
        it is a member of its own transitive membership.

Note that the latter of these actually does seem to me to forbid the
pathological example.  But the former gives the misleading impression
that the pathological example is legal.

I think to repair the problem the following should happen:

(1) Clause 5 of Simple Type Definition Representation OK should be
deleted as redundant.  If the WG is unwilling to do that, then
alternatively, add before the full stop the words ", nor any type
definition derived from it".  

(This does touch on the possibly sensitive issue of what purpose the
Schema Representation Constraints are intended to serve, and what
properties should hold for the class of schema documents that satisfy
the Schema Representation Constraints, which means it's important to
get clear on but might turn contentious.)

(2) The alignment of the rules for simple type definitions in
Datatypes and Structures must be worked through again, to ensure that
sanity checks of this kind are expressed in the Datatypes spec.

Because this involves potentially serious issues of design, I am
marking this needsAgreement, to signal the need for discussion by the
Working Group.  The editors can prepare wording, but I don't think a
specific wording proposal is likely to make any difference to the WG
Received on Wednesday, 26 September 2007 01:34:01 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:06 UTC