Saturday, December 10, 2011

XML Deserializer

XML Deserializing is great! Basically you can define any class structure, use the XML Deserializer to convert any XML to the object you defined, so long as the structures match, of course. This makes it way easy to parse XML. I just used it yesterday for the first time. Here's a great resource below:

http://msdn.microsoft.com/en-us/library/tz8csy73.aspx

In the msdn sample above, it uses an xml file, but if you want to read from an xml string, simply use the following syntax to populate your XmlReader object and the rest is the same:

XmlReader reader = XmlReader.Create(new System.IO.StringReader(xmlSTRING));

No comments:

Post a Comment