W3C home > Mailing lists > Public > public-xsd-databinding@w3.org > February 2006

Re: ISSUE-7 minOccurs=0 & xsi:nil

From: <Paul.V.Biron@kp.org>
Date: Thu, 2 Feb 2006 12:38:26 -0800
To: peter.hendry@capeclear.com
Cc: public-xsd-databinding@w3.org, public-xsd-databinding-request@w3.org
Message-Id: <OF4BCE7CA0.642BBC79-ON88257109.006CFADB-88257109.00716208@KP.ORG>

> If we have
> 
>     <complexType name="B">
>        <sequence>
>           <element name="E1" type="tns:A" minOccurs="0"/>
>        </sequence>
>     </complexType>
> 
> Then does the document
> 
> <tns:BE>
>   <E1 A1="text"></E1> <!-- or <E1 A1="text"/> -->
> </tns:BE>
> 
> result in the value "" or null for field E1 in an object model? I 
> believe in this case nillable="true" would have to be used to make this 
clear.

I think the schema spec is very clear on this point (well, as clear as the 
schema spec gets :-):

        [nil] would be false
        [schema normalized value] would be the empty string (which is 
different from null)

and this is indepentant of whether minOccurs='0' or nillable='true'.

Changing the declaration of E1 to:

        <element name='R1' type='tns:A' minOccurs='0' nillable='true'/>

and given the instance

<tns:BE>
  <E1 A1="text" nilable='true'/>
</tns:BE>

would cause

        [nil] to be true
        [schema normalized value] to be absent (i.e., have no value, which
                in most language bindings would be represented as NULL)

I'm still struggling to understand what the issue actually is here.

pvb
Received on Thursday, 2 February 2006 20:38:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 18:20:36 GMT