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

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3954


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
(http://www.w3.org/TR/xmlschema11-1/#src-simple-type):

    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)
(http://www.w3.org/TR/xmlschema11-1/#cos-st-restricts)

    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
discussion. 

Received on Wednesday, 26 September 2007 01:34:01 UTC