I am trying to create a generic class structure to save lists with various subitems in an xml file as XML attributes. Each subitem has Name (string) and a Value (double).
An example: The XML of two Lists - frame 1 and frame 2 - should look like this shown above. The frame1 is a List of the class rec. The class rec always contains multiple pairs of parameters and their values. In frame1 the class rec contains the parameters car, factory and height. And in frame2 book and page.
<frame1>
<rec car="0" factory="1" height="2" />
<rec car="1" factory="4" height="2" />
<rec car="2" factory="4" height="3" />
<rec car="3" factory="5" height="2" />
</frame1>
<frame2>
<rec book="0" page="1" />
<rec book="1" page="4" />
<rec book="2" page="4" />
<rec book="3" page="5" />
</frame2>
This is only an example. I do not want to create different classes with different properites for each "frame" List. I want to solve the problem with one class "rec" as the subitems are always changing. Is there a way to create this?
Thank you in advance