This is the xml i get back from a third part api :
<data>
<installations>
<installation>
<reader>1</reader>
<reader>2</reader>
<reader>3</reader>
<reader>4</reader>
</installation>
</installations
</data>
And these are the classes I have for now
public class data
{
public List<installation> installations
}
public class installation
{
// HERE I DON'T KNOW HOW TO DO THE <reader> STUFF
}
I hope someone knows how this should be done
/Martin
Your classes could look like this:
Two things are important here:
the use of
XmlElement("reader")to hide the<reader></ reader>nodes that would otherwise created due to theList<reader> readerproperty.the use of
XmlTextAttributeto have the the<reader><value>1</value></reader>created as<reader>1</reader>.