This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4076 - addB049: key with wider scope than keyref
Summary: addB049: key with wider scope than keyref
Status: RESOLVED FIXED
Alias: None
Product: XML Schema Test Suite
Classification: Unclassified
Component: Microsoft tests (show other bugs)
Version: 2006-11-06
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Henry S. Thompson
QA Contact: XML Schema Test Suite mailing list
URL:
Whiteboard: metadata fixed 2010-06-22
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-13 15:20 UTC by Michael Kay
Modified: 2010-07-06 14:30 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2006-12-13 15:20:06 UTC
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'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, "there must be a ·node table· associated with the {referenced key} in the [identity-constraint table] of the element information item". Here "the element information item" 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.
Comment 1 Zafar Abbas 2007-02-02 19:26:55 UTC
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.
Comment 2 Michael Kay 2008-06-22 17:04:57 UTC
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't be satisfied.
Comment 3 Michael Kay 2010-06-21 10:44:56 UTC
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.
Comment 4 Henry S. Thompson 2010-06-22 11:24:05 UTC
Previous comment correct, metadata fixed accordingly