[Bug 1232] [XPath] schema-element() and nillable

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1232





------- Additional Comments From mike@saxonica.com  2005-04-18 17:30 -------
You say: the only way in which a "nilled" property could cause an element to
fail to satisfy its element declaration is if the declaration specifies "not
nillable" but the element has "nilled" = "true".

I was under the impression that such an element could not exist. But I see now
that it can: if there's a global element declaration E(1) specifying
nillable="no", and a local element declaration E(2) specifying nillable="yes",
and if our particular element node specifies xsi:nil="true" and was validated
against E(2).

So it seems that the current rule is in fact logical. I'm not sure it's a good
rule - I would prefer nilled elements not to satisfy the schema-element(E)
SequenceType. (Actually, I would prefer nilled elements to disappear off the
face of the earth.) But since my objection was to the logic of the rule rather
than its desirability, I withdraw the comment. 

Some explanation, to avoid other readers going through the same logical
contortions, might be desirable. For example, the rule could be rephrased to 

3. If the element declaration for ElementName in the in-scope element
declarations is not nillable, then the candidate node is not nilled. (Note: this
condition might not be satisfied if the schema contains local element
declarations for ElementName as well as the global element declaration.)

Received on Monday, 18 April 2005 17:30:45 UTC