Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is it called nillable?

Tags:

xsd

In an XML schema you can mark an element as nillable meaning it can take an explicit NULL value. See nillable and minOccurs XSD element attributes for a great explanation.

What I'm curious about is why is it called nillable? I always see nillable and think it's a typo!

EDIT I appreciate that nil is a synonym for null. What I'm wondering is why nil was chosen, rather than the more common (in computer science) null. Particularly as it should really be nilable (note the single L)!

like image 285
RB. Avatar asked May 06 '11 14:05

RB.


People also ask

What does Nillable mean?

The nillable attribute specifies whether or not an explicit NULL value can be assigned to the element. True enables an instance of the element to have the NULL attribute set to true. The NULL attribute is defined as part of the XML Schema namespace for instances.

What does Nillable mean in xsd?

The presence of the xsd:nillable attribute in an XSD element means that the corresponding element in the XML file permits null values.

What does Nillable false mean?

nillable="false" means you can't have the attribute xsi:nil="true". But you don't have this attribute so this won't make it invalid.

What is minOccurs and maxOccurs in xsd?

The minOccurs attribute specifies the minimum number of times that the element can occur. It can have a value of 0 or any positive integer. The maxOccurs attribute specifies the maximum number of times that the element can occur.


1 Answers

What I'm wondering is why nil was chosen, rather than the more common (in computer science) null

This depends on which part of computer science you're coming from!

If you look at programs written in functional languages, you'll see nil every where, and very seldom null. And as it happens, XML and all it's siblings such as XSLT are closely related to functional languages.

like image 199
aioobe Avatar answered Oct 22 '22 05:10

aioobe