Pregunta

En .NET, puede serializar un elemento anulado usando XMLelement (isNullable= True), lo que resulta en esto:

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

Sin embargo, debo poder agregar XMLNS: XSI="http://www.w3.org/2001/xmlschema-instancia después de cualquier campo que se esté nullando.

Ejemplo:

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

¿Es esto posible?

¿Fue útil?

Solución

lo descubrí.Aquí está la respuesta:

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top