I am using traditional XmlReader to parse a xml document into a dictionary? However i am in search for less complicated method minimum lines of code. I have the following Xml document
<Msg>
<field id="0" value="0100"/>
<field id="3" value="310000"/>
<field id="7" value="0101150110"/>
<field id="11" value="000002"/>
</Msg>
Is it possible to split the following xml document into a dictionary object with key being the attribute and value being the value of that element?
eg:-
Key = 0 value =0100
Rather than using
XmlReader, I’d suggest using LINQ to XML, at which point it’s really simple: