W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2003

xsi:nil and identity constraints

From: Tim Hanson <Timothy.Hanson@bea.com>
Date: Thu, 24 Jul 2003 16:22:28 -0700
Message-ID: <7A157FEACF50074588EEC9497CA2B5EF19698A@seex01.beanw.com>
To: <xmlschema-dev@w3.org>

If an element selected by the field  of an identity constraint has xsi:nil='true', is the value treated as missing? For example, is the following instance valid, given the schema:

I think this should be valid since the xsi:nil attribute on the uid elements would be equivalent to the elements missing for the purposes of identity constraints. Either way 3.11.4 of Schema part 1 could use some clarification around xsi:nil.


<?xml version="1.0"?> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
        <xsd:element name="root"> 
                                <xsd:element ref="uid" maxOccurs="unbounded"/> 
                <xsd:unique id="foo123" name="uuid"> 
                        <xsd:selector xpath=".//uid"/> 
                        <xsd:field xpath="."/> 
        <xsd:element name="uid" nillable="true"/> 

<?xml version="1.0"?> 
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="idF018.xsd"> 
        <uid xsi:nil="true" xsi:type="xsd:string"/> 
        <uid xsi:nil="true"/> 
Received on Thursday, 24 July 2003 19:23:20 UTC

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