<Reports>
<Report>
<data Id="2018" type="4" />
<ReportAddendum>
<data raID="876" ratext="Text here 1." />
</ReportAddendum>
<ReportAddendum>
<data raID="134" ratext="Text here 2." />
</ReportAddendum>
<ReportAddendum>
<data raID="552" ratext="sfdsfsd" />
</ReportAddendum>
</Report>
Previously, there's no <ReportAddendum>
so I created the following:
[XmlRoot(ElementName = "Reports")]
public class ClassReport
{
[XmlArray("Report")]
[XmlArrayItem("data")]
public List<ReportList> Reports { get; set; }
}
public class ReportList
{
[XmlAttribute]
public string Id { get; set; }
[XmlAttribute]
public string type { get; set; }
}
Everything works fine. But the issue is the addendum which was added later on, is not being converted even if I add
[XmlRoot(ElementName = "Reports")]
public class ClassReport
{
[XmlArray("Report")]
[XmlArrayItem("data")]
public List<ReportList> Reports { get; set; }
[XmlArray("ReportAddendum")]
[XmlArrayItem("data")]
public List<AddendumList> AddendumList { get; set; }
}
then create a class similar to ReportList
.