xs:key and nillable elements

In Schema part 1, 3.11.4, Identity-constraint Definition Validation Rules,
Validation Rule Identity Constraint Satisfied, I'm trying to understand rule
4.2.3.

This applies to xs:key, and it states:

4.2.3 No element member of the ·key-sequence· of any member of the
·qualified node set· was assessed as ·valid· by reference to an element
declaration whose {nillable} is true.

Q1: the ·key-sequence· is a sequence of values, not of nodes, so I can't see
how it can have an "element member". But let's assume the rule was meant to
refer to the node from which the value was extracted.

Q2: we've already got a rule (4.2.1) that says, in effect, that the key
field can't be nilled. Why do we need another rule that it can't be
nillable? (Probably some flawed analogy with SQL, I guess.)

Q3: if this rule is violated, it's surely the schema that's wrong, not the
instance document? 

Q4: what does this note mean?

Note: Although this specification defines a ·post-schema-validation infoset·
contribution which would enable schema-aware processors to implement clause
4.2.3 above (Element Declaration (§3.3.5)), processors are not required to
provide it. This clause can be read as if in the absence of this infoset
contribution, the value of the relevant {nillable} property must be
available.

Presumably this is a reference to the [element declaration] PSVI
contribution in 3.3.5. Oddly, the spec says that the processor must either
retain [element declaration] or [nil]: for this rule, it seems to need both.
But perhaps that doesn't matter: I think the note is telling me that the
schema validator needs to retain this information even though it's not
needed for any other purpose, right?

Perhaps I should read the note as saying: "This rule is really difficult to
implement. Hard luck!".

Is it too late for the Schema WG to admit that xsi:nil was a bad dream and
we should all pretend it never happened?

Michael Kay

Received on Monday, 26 September 2005 11:01:33 UTC