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 11716 - Identity constraints: grammatical typo
Summary: Identity constraints: grammatical typo
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2011-01-10 15:55 UTC by Michael Kay
Modified: 2011-03-04 23:55 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael Kay 2011-01-10 15:55:40 UTC
In Part 1 section 3.11.4 clause 3

"For each node in the ·target node set· all of the {fields}, with that node as the context node, evaluates ..."

should surely be

"For each node in the ·target node set· each of the {fields}, with that node as the context node, evaluates ..."
Comment 1 Michael Kay 2011-01-10 16:16:39 UTC
Oh dear, it's worse than I thought.

"For each node in the ·target node set· all of the {fields}, with that node as the context node, evaluates to a sequence of nodes (as defined in XPath Evaluation (§3.13.4.2)) that only contains ·skipped· nodes and at most one node whose ·governing· type definition is either a simple type definition or a complex type definition with {variety} simple. 

[Definition:]  Call the sequence of the [schema actual value]s of the element and/or attribute information items in those node-sets in order the key-sequence of the node."

So, let's say there are the following {fields}

field1 evaluates to a sequence of two nodes which are both skipped.

field2 evaluates to a sequence of one attribute node with value "x"

field3 evaluates to an empty sequence

field4 evaluates to a sequence of one attribute node with value "y" and three elements that have a complex-type-with-complex-content


What are "those node-sets"? [It only seems to make sense if they are the results of the {field} evaluation, excluding skipped nodes and nodes whose type is a complex-type-with-complex-content]

What is the key-sequence? [It only seems to make sense if the key-sequence includes a value of .absent. corresponding to a {field} whose evaluation yielded an empty sequence, but this is nowhere stated]
Comment 2 Henry S. Thompson 2011-01-11 13:33:50 UTC
Oh boy, there's certainly a can of worms here.  Comparing this section to 3.11.4 from V1 (http://www.w3.org/TR/xmlschema-1/#d0e13803), there are a number of what at first appear to me to be unmotivated changes.  The most important of these is the change from "a node-set with exactly one member" in the definition of *qualified node set* to "a node sequence one of whose members", which seems to me to depend too obscurely on the implicit uniqueness arising from item 3 in the preceding list.

Would the following be a) correct and b) simpler?

3) For each node *N* in the ·target node set·, for each *F* of the {fields}, define *NS(N,F)* as the sequence of nodes that *F* evaluates to with *N$ as the context node (as defined in XPath Evaluation (§3.13.4.2)).  *NS* consists of zero or more ·skipped· nodes and at most one node with a non-·absent· [schema actual value]. [Definition:]  Define the key-sequence of *N* as the sequence of [schema actual value]s of those nodes in *NS(N,F)* which have one for each *F*, in order.
Comment 3 Henry S. Thompson 2011-01-11 13:38:27 UTC
And change bullet 4 to read

4 [Definition:]  The qualified node set is the subset of the ·target node set· consisting of those nodes for which each of the {fields} evaluates to a node sequence exactly one of whose members is a node with a ·non-absent· [schema actual value].
Comment 4 C. M. Sperberg-McQueen 2011-01-11 15:32:59 UTC
Background information (i.e. no proposal yet):

In re comment 2:  speaking for myself, the replacement of the term "node set"  with the term "node sequence" does not seem to me to be unmotivated; the term "node set" in XPath 1.0 is a bit of a misnomer, since the nodes are sequenced, and the term "node set" is no longer used in the version of XPath to which XSD normatively refers.  My personal view is that many more occurrences of 'set' ought to have been replaced here by current terminology, but the WG decided otherwise.

I also cannot find the phrase "a node sequence one of whose members" in the status-quo text of clause 3 of the constraint; are we looking at the same version of the document?  Or is Henry suggesting, in comment 2, that the scope of the issue be broadened from clause 3 to clause 4, or to some larger area of the text?

Looking at clause 4, the definition of qualified node set changes from 

    the subset of the ·target node set· for which all the {fields} 
    evaluate to a node-set with exactly one member which is 
    an element or attribute node with a simple type

to

    the subset of the ·target node set· consisting of those nodes 
    for which all the {fields} evaluate to a node sequence one of 
    whose members is an element or attribute node with a 
    ·non-absent· [schema actual value]

The change to clause 4 was made to resolve bug 5781 and was approved 17 April 2009; see discussion in bug 5781 and in the April 2009 archive.

The subject/verb agreement problem and the ambiguous reference to "those node-sets" in clause 3 were introduced in XSD 1.0 and were apparently not caught (or were thought clear) when this constraint was revised.
Comment 5 C. M. Sperberg-McQueen 2011-01-28 17:31:49 UTC
On the WG call of 28 January 2011, the WG instructed the editors to revise this section for clarity and in particular to try to make it easier for the reader to see that for the problematic cases the identity of the key sequence does not matter, because the nodes are eliminated from consideration on other grounds.
Comment 6 C. M. Sperberg-McQueen 2011-03-04 15:36:36 UTC
A wording proposal intended to resolve this issue is at

  http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.b11716.bis.html
  (member-only link)
Comment 7 David Ezell 2011-03-04 16:25:35 UTC
 RESOLVED: adopt the proposal with the suggested ammendment in the email here:
 http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2011Mar/0001.html
Comment 8 C. M. Sperberg-McQueen 2011-03-04 23:16:31 UTC
The change proposal mentioned in comment 6 has been integrated into the status-quo document, as amended  So I'm marking this issue resolved.  Michael, over to you.