System.Xml.Serialization.XmlArrayAttribute.IsNullable Property

Gets or sets a value that indicates whether the System.Xml.Serialization.XmlSerializer must serialize a member as an empty XML tag with the xsi:nil attribute set to true.

Syntax

public bool IsNullable { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

The XML schema specification for structures allows an XML document to explicitly signal that an element's content is missing. Such an element contains the attribute xsi:nil set to true. For more information, see the World Wide Web Consortium (www.w3.org) specification titled "XML Schema Part 1: Structures."

If the XmlArrayAttribute.IsNullable property is set to true, the xsi:nil attribute is generated for class members that have been set to null. For example, if you set a field named MyStringArray to null, the System.Xml.Serialization.XmlSerializer generates the following XML code.

Example

 <MyStringArray xsi:nil = "true" />

If the XmlArrayAttribute.IsNullable property is false, no XML element is generated.

Note:

You cannot apply the XmlArrayAttribute.IsNullable property to a member typed as a value type because a value type cannot contain null.

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0