<?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>7913</bug_id>
          
          <creation_ts>2009-10-13 21:16:32 +0000</creation_ts>
          <short_desc>Strange result from definition of governing element declaration</short_desc>
          <delta_ts>2009-11-03 19:06:00 +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 XP</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="Kevin Braun">kbraun</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>28321</commentid>
    <comment_count>0</comment_count>
    <who name="Kevin Braun">kbraun</who>
    <bug_when>2009-10-13 21:16:32 +0000</bug_when>
    <thetext>The definition of governing element declaration seems to produce an odd effect.  According to the rules, when there is no processor-stipulated decl, and no context-determined decl, but there is a locally declared type, the governing element declaration is absent.

Consider this example:
&lt;xs:element name=&quot;elem1&quot; type=&quot;xs:int&quot; fixed=&quot;10&quot;/&gt;
&lt;xs:element name=&quot;elem2&quot; type=&quot;xs:int&quot; fixed=&quot;10&quot;/&gt;

&lt;xs:element name=&quot;root&quot; type=&quot;OddBall&quot;/&gt;

&lt;xs:complexType name=&quot;OddBall&quot;&gt;
   &lt;xs:sequence&gt;
      &lt;xs:element name=&quot;elem1&quot; type=&quot;xs:int&quot;/&gt;
      &lt;xs:any/&gt;
      &lt;xs:any/&gt;
   &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;

And consider this instance:
&lt;root&gt;
   &lt;elem1&gt;5&lt;/elem1&gt;
   &lt;elem1&gt;9&lt;/elem1&gt;
   &lt;elem2&gt;10&lt;/elem2&gt;
&lt;/root&gt;

The second elem1 is attributed to a strict wildcard; it does not have a context-determined declaration.  It does have a locally declared type, the local elem1 declaration.  The result is that elem1 does not have a governing declaration, and it not required to meet the fixed value constraint.  However, elem2 is in a fairly parallel situation, but it will have a governing element declaration and elem2&apos;s fixed value will apply.

Perhaps I have missed something, but this seems quite odd to me.  I can&apos;t quite make out why 3.3 in the definition of governing element declaration is there.  Also, it looks like this is different behavior from XSD 1.0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28358</commentid>
    <comment_count>1</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2009-10-14 20:43:28 +0000</bug_when>
    <thetext>Thank you for the comment.  At the moment, I too am puzzled by clause 3.3 of the definition of governing element declaration.  (I&apos;m also puzzled by 3.2.)  The WG will have to examine this carefully before deciding what to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28403</commentid>
    <comment_count>2</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2009-10-16 16:22:26 +0000</bug_when>
    <thetext>On the telcon (see the minutes)
MSM: concrete proposal: a) remove clause 3.3 and b) allow editors some time to make sure such change doesn&apos;t break something we tried to fix with this clause.

and then

MSM: Propose to still delete 3.3 and try to find a different to allow falling back to the local type when the content is invalid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29205</commentid>
    <comment_count>3</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2009-10-29 21:39:31 +0000</bug_when>
    <thetext>A wording proposal intended to resolve this issue is now on the server at

  http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.b7913.html
  (member-only link)

The proposal does two things.  First, as requested by the WG it introduces the variable E to provide a name for the element instance whose governing element declaration is being defined, similar in effect to the E used by the definition of governing type definition immediately following.

Second, it inserts a new rule three in front of the old one (which now becomes rule 4):

  3 A declaration ·resolved· to by E&apos;s [local name] and [namespace name], provided 
    that E is ·attributed· either to a strict ·wildcard particle· or to a lax ·wildcard 
    particle·.

This has the effect that when an element instance is attributed to a wildcard, it gets the appropriate global element declaration.  And the effect originally aimed at by clause 3.3 (now 4.3) is retained:  when the element is not attributed to a wildcard at all (because its parent is invalid and we are in a fallback mode, trying to get what information we can out of things), it uses a locally declared type if there is one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29235</commentid>
    <comment_count>4</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2009-10-30 21:06:07 +0000</bug_when>
    <thetext>The wording proposal mentioned in comment 3 was approved by the XML Schema working group on its call today and has been integrated into the status-quo documents.  Accordingly I&apos;m marking this issue resolved.

Kevin Braun, it would be helpful if you, as the originator of the issue report, would indicate by closing the issue that you are satisfied with the WG&apos;s consideration and resolution of the issue, or by reopening it indicate that you are dissatisfied (and explain why).  If we don&apos;t hear from you in the next two weeks on this question, we will assume you are satisfied.  (I am assuming that the description of the change given in comment 3 suffices for your review; if you need more detail let me know.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29267</commentid>
    <comment_count>5</comment_count>
    <who name="Kevin Braun">kbraun</who>
    <bug_when>2009-11-03 19:06:00 +0000</bug_when>
    <thetext>Sounds good.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>