[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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>
xsi:nil when validating by type

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
http://www.saxonica.com/
Received on Saturday, 9 December 2006 21:39:13 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.