I have the following xml I want to deserialize into object. I’m using C#.
<?xml version = '1.0' encoding = 'windows-1251'?>
<RootElement>
<AnotherRoot>
<parameter name="param1">
<value>"12"</value>
</parameter>
<parameter name="param2">
<value>"John"</value>
</parameter>
</AnotherRoot>
</RootElement>
Any idea?
You could opt with the following
Inside your code
XmlSerializer serializer = new XmlSerializer(typeof(YourRootElement));
YourRootElement deserializedObject = (YourRootElement)serializer.DeSerialize(File.Open(yourXmlFileLocation);
Now you can work with it in a familiar C# object oriented way.