We've a problem with an XMl file from a application (not own written). The XML data is:
<?xml version="1.0"?>
<content>
<data timestamp="1477118232031">
<item0 attr1="0" attr2="TA" attr3="true" attr4="350.87" />
<item1 attr1="0" attr2="TA" attr3="true" attr4="350.87" />
<item2 attr1="0" attr2="TA" attr3="true" attr4="350.87" />
<!-- ... -->
<itemNN attr1="0" attr2="TA" attr3="true" attr4="350.87" />
</data>
<content>
Is it possible to deserialze item0 - itemNN in an array (or list) in the data class ?
public class data {
[XmlElement("itemNN?")] // here is the problem
public List<item> Items { get; set; }
[XmlAttribute("timestamp")]
public int timestamp;
}
public class item {
[XmlAttribute("attr1")]
public string attr1 { get; set; }
//....
}
The XML file has many more elements with the same problem.