Home All Groups Group Topic Archive Search About

array xml serialization - how to add attribute?

Author
1 Sep 2006 11:26 AM
gk
Hi,

is there a way to add attributes to a xml serialized array?
e.g. the default is

<array>
  <element_type>element</element_type>
  <element_type>element</element_type>
  ...
  <element_type>element</element_type>
</array>

but i would like

<array Count=n>
  <element_type>element</element_type>
  <element_type>element</element_type>
  ...
  <element_type>element</element_type>
</array>

where "n" is array.Count


I tried XmlAttributeOverrides with XmlIgnore = false on the "Count"
member of typeof(IList) ... but that didn't work. Is this because
"Count" is read-only?

Any ideas?


Greetings,

gk

AddThis Social Bookmark Button