【发布时间】:2012-03-27 05:08:19
【问题描述】:
在 .NET 中,您可以使用 XmlElement( IsNullable = true ) 序列化可为空的元素,结果如下:
<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"/>
这可能吗?
【问题讨论】:
标签: .net serialization nullable xml-nil