Parse XML string value into Dictonary object using C#

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have a string containing field/value pairs in xml format and want to parse it into Dictionary object.
<pre lang="x-c# string param = "<fieldvaluepairs><fieldvaluepair><field>name</field><value>David Boon</value></fieldvaluepair></fieldvaluepairs>";[/code]
Is there a quick and simple way to read and store all the field/value pairs in Dictionary object? No LINQ please.
Also, there could be possibility that the value field can contain an xml string itself. Please feel free to suggest any modification in xml format if you think it can make things easier to store in Dictionary object.

View the full article
 
Back
Top