Home>Knowledge Base>Support FAQ>Liquid XML Data Binding>Handling Nillable items and xsi:Nil
Information
Article ID68
Created On11/1/2010
Modified11/1/2010
Share With Others

Handling Nillable items and xsi:Nil

If an item is marked as Nillable in a schema:
<xsd:element name="author" type="bs:authorName" nillable="true" />

The code generator will generate a new class generated for the Nillable item:
public bs.Author_Nillable Author { get; set; }

The Nillable class will contain an IsNil property:
public Boolean IsNil

Setting this IsNil = true will omit cause the xml written out to show the item as xsi:Nil.

This is not the same as setting optional types to Null, this is covered in the article:
http://www.liquid-technologies.com/SmarterTrack/KB/a55/setting-empty-values-using-isvalid-and-null.aspx