• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Effect of nillable=true

 
Xia Lee
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is I have an element like this :

<xsd:element name="abc" type="xsd:string" nillable="true"/>

Are these three right :

<abc nil="1"></abc>
<abc nil="true"></abc>
<abc>abcde</abc>
 
Rinku Singh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes they are right !
 
Rodrigo Dinis
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a little bit tricky because you didn't declared the "nil" attribute in the element. The "nillable" attribute from the XML Schema is just to say if the element can or cannot to be without a value, empty. So from my point of view only the last is right.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See XML Schema Part 0: Primer Second Edition: 2.9 Nils


Correct:


NULL - The database's black hole

An area where empty and null mean different things and "nillable" comes into play
Web Services Programming Tips and Tricks: Array Gotcha - Null Array vs. Empty Array
[ November 26, 2008: Message edited by: Peer Reynders ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic