W3C home > Mailing lists > Public > xml-dist-app@w3.org > September 2003

Re: Is whitespace allowed with xsi:nil="true" ?

From: David Fallside <fallside@us.ibm.com>
Date: Tue, 2 Sep 2003 12:13:00 -0700
To: Kintali Shiva Prasad <shiva@sarvega.com>
Cc: xml-dist-app@w3.org
Message-ID: <OFD5C04C34.6DEDD3A3-ON88256D95.0068A4E5-88256D95.00698F92@us.ibm.com>





Shiva, I believe your question should be directed to an XML Schema related
mailing list such as XML-dev: http://lists.xml.org/archives/xml-dev/.


............................................
David C. Fallside, IBM
Data Management Standards
Tel 530.477.7169 (TL 544.9665)
fallside@us.ibm.com



|---------+---------------------------->
|         |           Kintali Shiva    |
|         |           Prasad           |
|         |           <shiva@sarvega.co|
|         |           m>               |
|         |           Sent by:         |
|         |           xml-dist-app-requ|
|         |           est@w3.org       |
|         |                            |
|         |                            |
|         |           08/12/2003 05:18 |
|         |           PM               |
|---------+---------------------------->
  >------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                              |
  |       To:       xml-dist-app@w3.org                                                                                          |
  |       cc:       Kintali Shiva Prasad <shiva@sarvega.com>                                                                     |
  |       Subject:  Is whitespace allowed with xsi:nil="true" ?                                                                  |
  >------------------------------------------------------------------------------------------------------------------------------|





Hi All,

I have a question on xsi:nil

Validating the following instance documents against niltest.xsd, I get
the following results :

MSV                          niltest.xml  is valid
niltest-whitespace.xml  is valid
Xerces                        niltest.xml  is valid
niltest-whitespace.xml  is NOT valid

I am wondering, what the correct behaviour is ?

niltest.xsd:
--------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:element name="root">
  <xsd:complexType>
   <xsd:sequence>
         <xsd:element nillable="true" name="name" type="xsd:int" />
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
</xsd:schema>

niltest.xml:
------------
<?xml version="1.0"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:noNamespaceSchemaLocation="test.xsd">
<name xsi:nil="true"></name>
</root>

niltest-whitescape.xml:
------------------------------
<?xml version="1.0"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:noNamespaceSchemaLocation="test.xsd">
<name xsi:nil="true">
</name>
</root>

----------------------
NOTE : Difference between niltest.xml and niltest-whitespace.xml is the
newline in <name> tag.


Thanks & Regards
-Shiva
Received on Tuesday, 2 September 2003 15:56:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:15 GMT