I am trying to solve a puzzle with xml attributes. The problem is that we already have widely used file with this structure, from which I can\'t deviate
Looks like I just solved it. I have never seen this before, looked on MSDN, hence I didn't try it. But I tried instead of this
[XmlArrayItem(ElementName = "CONFIG", Type = typeof(MyConfigSchema))]
public MyConfigSchema[] Schemas { get; set; }
do this
[XmlElement(ElementName = "CONFIG", Type = typeof(MyConfigSchema))]
public MyConfigSchema[] Schemas { get; set; }
Instead of XmlArrayItem
I placed XmlElement
and it worked. I didn't know one can mark List or array with plain element attribute.