Question

in .NET, vous pouvez sérialiser un élément nullable à l'aide de XMLElement (islamlable= true), ce qui entraîne:

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

Cependant, je dois être capable d'ajouter xmlns: xsi="http://www.w3.org/2001/xmlschema-Instance après tout domaine qui est annulé.

Exemple:

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

est-ce possible?

Était-ce utile?

La solution

Je l'ai compris.Voici la réponse:

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top