OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: Is whitespace allowed with xsi:nil="true" ?
  • From: Kintali Shiva Prasad <shiva@sarvega.com>
  • Date: Tue, 02 Sep 2003 14:39:35 -0500
  • Organization: Sarvega Inc
  • User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

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> content.


Thanks & Regards
-Shiva






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS