你可以添加额外的属性到.NET序列化NULL值吗?

问题描述:

在.NET中,可以使用的XmlElement(ISNULLABLE = true),这将导致该序列可空的元素:你可以添加额外的属性到.NET序列化NULL值吗?

<SomeElement xsi:nil="true" />. 

不过,我需要能够添加的xmlns:XSI =“HTTP:// www.w3.org/2001/XMLSchema-instance之后被清零任何领域

例:

<SomeElement xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> 

这可能

我想通了?答案如下:

[XmlElement(IsNullable = true, Namespace = "http://www.w3.org/2001/XMLSchema-instance")]