0

In .NET, you can serialize a nullable element using XmlElement( IsNullable = true ), which results in this:

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

However, I need to be able to add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance after any field that is being nulled out.

Example:

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

Is this possible?

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Jaden
  • 179
  • 2
  • 2
  • 11

1 Answers1

0

I figured it out. Here is the answer:

[XmlElement(IsNullable = true, Namespace = "http://www.w3.org/2001/XMLSchema-instance")]
Peter O.
  • 32,158
  • 14
  • 82
  • 96
Jaden
  • 179
  • 2
  • 2
  • 11