W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2006

xsi:nil when validating by type

From: Michael Kay <mike@saxonica.com>
Date: Sat, 9 Dec 2006 21:39:06 -0000
To: <xmlschema-dev@w3.org>
Message-ID: <008401c71bda$73d6b5a0$6401a8c0@turtle>

Is it true to say that when an element is validated against a type (as
distinct from being validated against an element declaration - for example
when validating within xs:anyType content) then:

   xsi:nil is allowed, and must (if present) be a valid boolean, but its
value is ignored.

In particular xsi:nil="true" is permitted but it neither allows nor requires
the content to be empty if the type itself does not permit empty content.

This seems to be what Validation Rule: Element Locally Valid (Type) is
saying, the relevant consideration being that "clause 3.2 of Element Locally
Valid (Element) (3.3.4) did not apply", because we were not validating
against an element declaration.

(Actually, I can't see a detailed chain of reasoning that allows me to
conclude that validation should fail if the attribute xsi:nil="fgjh" is
present, but I assume that in this case common-sense prevails.)

Test case elemZ033b is related, though in this case the instance is valid
whether xsi:nil is ignored or not.

Michael Kay
Received on Saturday, 9 December 2006 21:39:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:11 UTC