I have the following XML...
<configuration>
<img name="name1" />
<img name="name2" />
<warn>
<img name="warn1" />
</warn>
</configuration>
...which I try to deserialize into...
[XmlType("img")]
public class ImageNameExceptionItemXml
{
[XmlAttribute("name")]
public string Filename;
}
[XmlRoot("configuration")]
public class ImageNameExceptionListXml: List<ImageNameExceptionItemXml>
{
[XmlArray("warn")]
[XmlArrayItem("img")]
public ImageNameExceptionListXml WarnList { get; set; }
}
...but I end up with the WarnList property null.
I already tried...
[XmlElement("warn"}]
public ImageNameExceptionListXml WarnList { get; set; }
...or...
[XmlElement("warn"}]
public List<ImageNameExceptionItemXml> WarnList { get; set; }
...but I still end up with WarnList property null. Why is that?
<warn>node. Maybe I can try <configuration> <img name="name1" /> <img name="name2" /> <warnImg name="warn1" /> </configuration>