<?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>10652</bug_id>
          
          <creation_ts>2010-09-18 23:02:25 +0000</creation_ts>
          <short_desc>xs:override and document-level defaults</short_desc>
          <delta_ts>2011-03-04 23:50:45 +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>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>resolved</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="David Ezell">David_E3</assigned_to>
          <cc>cmsmcq</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>39100</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-09-18 23:02:25 +0000</bug_when>
    <thetext>A consequence of the way xs:override is specified is that document-level defaults (elementFormDefault, attributeFormDefault, blockDefault, finalDefault, defaultAttributes, xpathDefaultNamespace, defaultOpenContent) in the overriding document have no effect on declarations nested within an xs:override element in that document; instead, the effective values are those that apply in the overridden document.

This behaviour is different from xs:redefine.

The purpose of this bug report is 

(a) to check that this was indeed the intention of the WG (I don&apos;t recall it being discussed, and it doesn&apos;t seem intuitively correct)

(b) to ask whether it would be appropriate to add Notes to warn the user of surprises in this area. It&apos;s currently very easy to misread statements such as that in 3.3.2 

(&quot;Control over whether element information items ·validated· by a local declaration must be similarly qualified or not is provided by the form [attribute], whose default is provided by the elementFormDefault [attribute] on the enclosing &lt;schema&gt;, via its determination of {target namespace}.&quot;)

without realizing that the term &quot;enclosing &lt;schema&gt;&quot; is to be understood as applying to the post-transformation schema document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39300</commentid>
    <comment_count>1</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2010-09-24 16:06:52 +0000</bug_when>
    <thetext>WG discussed and decided not to change the transform, but to clarify the text to make the effects apparent.  Also clarify the effects of namespace bindings.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45016</commentid>
    <comment_count>2</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2011-02-02 15:00:23 +0000</bug_when>
    <thetext>I propose to resolve this by inserting the following note in the
sequence of notes following Schema Representation Constraint: Override
Constraints and Semantics, immediately following the note reading

   Note: It is Dold&amp;#8242; and not Dold, which is required to correspond to
   a conforming schema. In particular, it is not an error for Dold to
   fail to satisfy all of the constraints governing schema documents,
   while it is an error if Dold&amp;#8242; fails to satisfy them.

The proposed addition:

   Note: The effect of override pre-processing is that any
   declarations and definitions contained within an &lt;override&gt; will
   be substituted for matching declarations and definitions within
   the target set; the resulting schema documents will then be
   processed normally, as described in the relevant portions of this
   specification. This has the effect that the rules for
   document-level defaults (elementFormDefault, attributeFormDefault,
   blockDefault, finalDefault, and so on) are applied not in the
   context of the document containing the &lt;override&gt; (Dnew) but in
   the context of the document containing the original overridden
   declaration or definition (Dold). Unexpected results may be
   minimized if the children of an &lt;override&gt; are made independent of
   the document-level defaults by explicitly specifying the desired
   values for the properties in question.

For the record, I note that I think it would be technically feasible (if
a little fiddly to specify and get right) to supply explicit values 
automatically for all the document-level defaults, before processing 
the included element.  That&apos;s not the direction taken in this change 
proposal because it&apos;s not the direction taken in the WG&apos;s phase-1 agreement
on technical direction.  It can in any case also be done by a utility 
stylesheet anyone could provide for use by schema authors who dislike
the default behavior; it does not need to be written into the XSD spec
and the task does not need to be performed by the schema processor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45180</commentid>
    <comment_count>3</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2011-02-07 15:37:31 +0000</bug_when>
    <thetext>Adopted as proposed on telcon 2011-02-04</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46366</commentid>
    <comment_count>4</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2011-03-04 22:40:53 +0000</bug_when>
    <thetext>The changes mentioned in comment 2 have been integrated into the status-quo document, so I&apos;m marking this issue as resolved.

Michael, if you would close or reopen as needed?  Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>