<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6056</bug_id>
          
          <creation_ts>2008-09-12 14:16:45 +0000</creation_ts>
          <short_desc>Make identity constraints propagate through substitution groups?</short_desc>
          <delta_ts>2008-11-06 19:22:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Structures: XSD Part 1</component>
          <version>1.1 only</version>
          <rep_platform>Macintosh</rep_platform>
          <op_sys>Mac System 9.x</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>decided</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="C. M. Sperberg-McQueen">cmsmcq</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          <cc>David_E3</cc>
    
    <cc>johnarwe</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>21876</commentid>
    <comment_count>0</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2008-09-12 14:16:45 +0000</bug_when>
    <thetext>Section 3.3.2.1 Common Mapping Rules for Element Declarations
specifies that the {identity-constraint definitions} property of an
element declaration component contains just those identity constraints
mapped to by the relevant children of the element&apos;s source
declaration.

The SML Working Group, in contrast, has found it desirable to ensure
that if a particular element declaration E carries a set of identity
constraints, those constraints (or a more restrictive set of
constraints) are also carried by each element declaration
substitutable for E.  

For example: if a &lt;student&gt; element is required to have a key
reference which corresponds to some element in the Students document,
then a &lt;graduate-student&gt; element, which is conceptually a refinement
of the &lt;student&gt; element, should also be required to have an
appropriate key reference.

In short: XSD does not ensure that the (XSD) identity constraints on
an element E are also obeyed by elements substitutable for E; SML does
ensure that the analogous SML identity constraints are obeyed by
substituted elements.

This state of affairs seems to raise two problems:

  (1) The lack of alignment between the two specifications is
      likely to prove confusing for users of the two specs.  The lack
      of alignment was raised as an issue against SML in bug 4643, but
      the SML Working Group declined to change the SML rule, on the
      grounds that the constraints imposed by it are necessary for
      reliable specification of constraints.

  (2) The rule adopted by XSD appears to make it too easy for
      document authors or schema extenders to evade or subvert
      identity constraints imposed by a schema, and too hard for
      schema authors to prevent such evasions.  (The only obvious way
      to prevent them is to block substitution entirely, which is
      throwing out the baby with the bath water.)

Either of these seems sufficient reason to request that the XML Schema
WG consider aligning its rules for the interaction of identity
constraint and subsitution groups with those of the SML specification.

The simplest way to align the two specs would be for XSD 1.1 to specify

  (a) that if no identity constraints are specified in a source
      declaration, then the identity constraints of the 
      substitution-group head are inherited, and 
  (b) that as a constraint on schemas, the {identity-constraint
      definitions} of any element must be a restriction of
      those of its substitution-group head.  (The nature of
      restriction will also need to be defined.)

The relevant rules of SML, for those who would like to review them,
may be found by examining the occurrences of the phrase &quot;substitution
group&quot; in sections 5.2.1.1 and 5.2.1.2.  Analogous provisions relating
to SML&apos;s target* constraints and Schematron rules may be found in
5.1.2.1, 5.1.2.2, and 6.3.1.  The most recent public draft of SML is
at http://www.w3.org/TR/sml/ and the current editors&apos; draft is at
http://dev.w3.org/cvsweb/~checkout~/2007/xml/sml/build/sml.html?content-type=text/html;%20charset=utf-8

This bug report grows out of discussions in the SML Working Group, and
reflects an SML WG decision to suggest aligning the two specs as
described above; that decision was captured in the form of an action
(http://www.w3.org/2005/06/tracker/sml/actions/137) which this bug
report discharges.  But from a formal point of view, the SML WG has
not reviewed or endorsed the issue description above. I am filing this
report today in order that it be on record before the close of the
last-call comment period; I expect the SML Working Group to consider
at its meeting next Thursday whether to endorse it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21939</commentid>
    <comment_count>1</comment_count>
    <who name="John Arwe">johnarwe</who>
    <bug_when>2008-09-18 18:13:01 +0000</bug_when>
    <thetext>On its teleconference of 2008-09-18, the SML working chose to endorse this bug without any objections.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21940</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-09-18 18:32:52 +0000</bug_when>
    <thetext>I think it was a mistake to put identity constraints on elements; they should be constraints on types. If that were the case, there would automatically be a constraint of consistency within the type hierarchy, which in turn would force consistency within a substitution group.

It&apos;s hard to impose a constraint in XSD 1.1 that wasn&apos;t there in 1.0 (this comment is another one that has really been misclassified as a 1.1 comment when it addresses things that were equally true in 1.0). So perhaps the answer is for 1.1 to allow identity constraints on types as well as on elements, and enforce the consistency rule only for constraints on types?

However, that&apos;s a new feature, and we really shouldn&apos;t be adding new features after a second last call.

(personal comment)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22271</commentid>
    <comment_count>3</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2008-10-29 18:15:17 +0000</bug_when>
    <thetext>The WG discussed this issue on 10 October 2008, and concluded that while the idea may be a good one, adopting it now would substantially delay XSD 1.1.  Accordingly, we are closing it with a disposition of LATER.

The originator is requested to convey this result back to the SML WG and
let us know whether they are happy with this disposition.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22376</commentid>
    <comment_count>4</comment_count>
    <who name="John Arwe">johnarwe</who>
    <bug_when>2008-11-06 19:22:56 +0000</bug_when>
    <thetext>On 11/6 the SML working group endorsed the resolution in comment 3 without objection.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>