This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The Sun contribution (about to be published, URI will follow) to the test collection includes the following, which not only makes my head hurt, but sends XSV into an infinite loop: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:simpleType name="abcOrBoolean"> <xsd:union memberTypes="xsd:boolean abc"/> </xsd:simpleType> <xsd:simpleType name="abc"> <xsd:restriction base="abcOrBoolean"> <xsd:minLength value="5"/> </xsd:restriction> </xsd:simpleType> </xsd:schema> I believe this manages to escape both the ban on circular unions and the ban on circular derivations, as currently stated. But it _should_ be banned (and the person who thought of it offered counselling :-)
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.
A wording proposal intended to resolve this issue is at http://www.w3.org/XML/Group/2004/06/xmlschema-2/datatypes.b3235.html (member-only link).
The wording proposal in comment #2 was adopted by the WG at today's call. We believe this resolves the issue, so I am marking it accordingly. Henry, as the originator of the issue, would you please indicate by closing the issue that you are happy with the resolution (well, satisfied if not happy), or by reopening it that you are not satisfied? If we don't hear from you within the next two weeks, we expect to assume that silence implies consent.