<?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>4076</bug_id>
          
          <creation_ts>2006-12-13 15:20:06 +0000</creation_ts>
          <short_desc>addB049: key with wider scope than keyref</short_desc>
          <delta_ts>2010-07-06 14:30:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema Test Suite</product>
          <component>Microsoft tests</component>
          <version>2006-11-06</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>metadata fixed 2010-06-22</status_whiteboard>
          <keywords></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="Henry S. Thompson">ht</assigned_to>
          
          
          <qa_contact name="XML Schema Test Suite mailing list">public-xml-schema-testsuite</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>13161</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-12-13 15:20:06 +0000</bug_when>
    <thetext>This report relates to the Microsoft Additional test set, test group addB049, which uses the schema test72232_1.xsd and the instance document test72232_1.xml.

I&apos;m hesitant to raise a bug on an issue concerning key and keyref with different scope, because the spec here is so complex that there is probably only one person who understands it and that person is not me. However, I believe the instance is invalid, and Xerces appears to agree. The published metadata says that the schema and instance are both valid.

References are to Validation Rule: Identity-constraint Satisfied

In this example the keyref is associated with element B, which is a child of element root; the referenced key is associated with element root. The element structure contains no recursion.

Under rule 4.3, &quot;there must be a ·node table· associated with the {referenced key} in the [identity-constraint table] of the element information item&quot;. Here &quot;the element information item&quot; refers to element B. I believe that element B has no node table associated with the referenced key, because an element only acquires such a node table either (a) if the key is defined on that element, or (b) if one of its children has a node table for the key.

Informally, the rule seems to be that a keyref can have wider scope than the corresponding key, but it cannot have narrower scope.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13891</commentid>
    <comment_count>1</comment_count>
    <who name="Zafar Abbas">zafara</who>
    <bug_when>2007-02-02 19:26:55 +0000</bug_when>
    <thetext>Agreed that this test is not valid to be published as a compliance suite. We are
following up with the WG to determine the process of updating the test suite.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20737</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-06-22 17:04:57 +0000</bug_when>
    <thetext>Discussion of this bug led to long and complex discussion trying to understand the spec.

We conjectured that the rules for key/keyref could be replaced by creating some kind of assertion: given E1 with keyref name=KR select=S field=F and E2 with key name=KN select=T field=G, we are saying something like

for each E1
for each s in eval(S)
let v := eval(F)
for each E2
some t in eval(T)
satisfies eval(G) = v

But en route we confirmed that it seems to be the case that a keyref with lower scope that the key won&apos;t be satisfied.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36300</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-06-21 10:44:56 +0000</bug_when>
    <thetext>I believe the metadata for the test has been updated incorrectly. The schema has been changed from valid to invalid, while the instance is still marked as valid. The schema should have been left unchanged (as valid) and the instance marked invalid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36329</commentid>
    <comment_count>4</comment_count>
    <who name="Henry S. Thompson">ht</who>
    <bug_when>2010-06-22 11:24:05 +0000</bug_when>
    <thetext>Previous comment correct, metadata fixed accordingly</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>