What does i: nil = "true" mean?

I have xml and it has nodes with i: nil = "true" in it. What does it mean?

For example:

<FirstName i:nil="true" /> 

Does this mean anything other than:

 <FirstName /> 

If so, what is the difference?

+42
null xml xml-nil
Jan 20 '09 at 23:56
source share
3 answers

That means FirstName is null

 <FirstName i:nil="true" /> 

This means FirstName = ""

 <FirstName /> 

Assumptions made in FirstName are of string type.

+72
Jan 21 '09 at 0:00
source share

Maybe i:nil actually means xsi:nil , this means that the FirstName element is empty, i.e. doesn't have any content - not even "" . It refers to the nillable property in the XML schema.

+8
Jan 21 '09 at 11:55
source share

nil is an attribute defined in the namespace i . For this, the FirstName node attribute is true .

It looks like this, just with different names and meanings:

 <form name="test">... 

Here, form is the name of the node, similar to FirstName from your code, and name is the attribute with the value "test", similar to your attribute nil with the value "true".

What this means depends on the application reading the XML document.

If I dared to suggest, I would say that it looks like part of an XML document defining some kind of schema, and that the FirstName field can be NULL or nil , that is, empty or unknown.

+4
Jan 21 '09 at 0:00
source share



All Articles