Share on Google+Share on Google+

Nil Values

Advertisement
This is an optional attribute. Its value can be set to true or false. Its default value is false. It defines that an element can be assigned null value explicitely.

Nil Values

This is an optional attribute. Its value can be set to true or false. Its default value is false. It defines that an element can be assigned null value explicitely. If it is set to true then the attribute value can be set to null.

For example, "detail" is the element which is of string type and its "nillable" attribute is set to true. It means "detail" element can have nil value.
<xs:element name="detail" type="xs:string" nillable="true"/>

Due to setting the nillable attribute of element to true, the nil value can be set for the elements by setting the xsi:nil attribute to true.

<detail xsi:nil="true"/>

Advertisements

Posted on: November 22, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.