I need to read an XML file to a dictionary.
I read few guides and I only got confused from weird words that I don’t understand (such as nodes, XML validation etc.).
So, could you please walk me through?
I have an XML file which is written in this format:
<database>
<def number="1" name="one"/>
<def number="2" name="two"/>
</database>
As mentioned, I want to store it in a dictionary. How would I go about that?
This:
XElement(starting at<database>)<def ...>elements@numberas the key (interpreting as anint), and@nameas the value (as a string)data, which is implicitly typed asDictionary<int,string>