tags:

views:

47

answers:

1

What's the best way of parsing the folowing rss feed item into a C# class.

<item>
  <fh:FlightHistory FlightHistoryId="189895136" >
     <fh:Airline AirlineCode="EI" Name="Aer Lingus" /> 
  </fh:FlightHistory>
</item>
+2  A: 

You can use xsd.exe to generate classes from xml/xsd, then use the XmlSerializer to serialize and deserialize class instances in your code. here: http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.80).aspx

Alternatively there's a tool in the Biztalk SDK that allows you to "Paste XML as Serializable type" http://blogs.msdn.com/mwinkle/archive/2007/05/14/paste-xml-as-serializable-type.aspx

Doobi
<Grumble> You beat me by 30 seconds. Voted you up for good measure. Good answer.
BJ Safdie