Using xml: How to deserialize xml nodes with a different name into a list on newest questions tagged xml – Stack Overflow

I want to deserialize an xml file using c#.

the file has this form:

<parent>
   <TotProd Name="Total Produce Kwh">
       <Time value="00:00:00">10</Time>
       <Time value="00:30:00">10</Time>
        ............
   </TotProd>
   <ProdToNet Name="Produce to Net (iec)">
       <Time value="00:00:00">10</Time>
       <Time value="00:30:00">10</Time>
        ...........
   </ProdToNet> .....
</parent>

I want to deserialize all child elements of parent into a List<Myclass> with TotProd/ProdToNet as a property of Myclass.

How can i do this.

See Answers


source: http://stackoverflow.com/questions/11735994/how-to-deserialize-xml-nodes-with-a-different-name-into-a-list
Using xml: using-xml



online applications demo