[2.0] XML serialization, how do i force the empty fields to be serialized?
Hi!
i suppose this is a simple question if someone is familiar with xml serialization.
I'm serializing a class which only consists of some string fields. I want to make sure that all the fields are written to the XML file, even if they are uninitialized empty strings. Is there any way to tell the xml serializer class to enforce this?
Re: [2.0] XML serialization, how do i force the empty fields to be serialized?
Add the attribute...
Code:
[XmlElement(IsNullable=true)]
to the fields you want serialized even when null.
:afrog:
Re: [2.0] XML serialization, how do i force the empty fields to be serialized?
Quote:
Originally Posted by crptcblade
Add the attribute...
Code:
[XmlElement(IsNullable=true)]
to the fields you want serialized even when null.
:afrog:
:afrog: i wish i could serialize you as a token of my appreciation. Thanks! :afrog: