c# - .NET XML Deserialization -


I have the following XML feed objects in a list I need to deserialization I How can I get the .NET 4.0 C #?

  & lt; Body & gt; & Lt; Games & gt; & Lt; Games & gt; & Lt; Lot_name & gt; Football & lt; / Lot_name & gt; & Lt; Awards & gt; & Lt ;! - The "division_" tag for each award ends with a different number - & gt; & Lt; Divisions_1 & gt; & Lt; Divisions & gt; 1 & lt; / Divisions & gt; & Lt; Match & gt; 5-2 & lt; / Match & gt; & Lt; Payment & gt; $ 10 & lt; / Payments & gt; & Lt; / Divisions_1 & gt; & Lt; Divisions_2 & gt; & Lt; Divisions & gt; 2 & lt; / Divisions & gt; & Lt; Match & gt; 3-2 & lt; / Match & gt; & Lt; Payment & gt; $ 5 & lt; / Payments & gt; & Lt; / Divisions_2 & gt; & Lt; / Awards & gt; & Lt; / Sports & gt; & Lt; / Sports & gt; & Lt; / Body & gt;    

See a good explanation.

Xsd.exe is a handy tool that comes with NAT SDK (software development kit) which can make life easier when you quickly type a strongly typed XML input You want to go to the .NET object.

If you are starting with an XML file:

1) Open the XML file in Visual Studio

2) Create the "Schema" from the XML menu Click on This will generate an XSD file.

The rest.

Comments