How to download the following XML document format:
<Settings> <MimeTypes> <MimeType Type="application/mac-binhex40" Extensions=".hqx"/> <MimeType Type="application/msword" Extensions=".doc;.docx"/> <MimeType Type="application/pdf" Extensions=".pdf"/> <MimeType Type="application/vnd.ms-excel" Extensions=".xla;.xlc;.xlm;.xls;.xlt;.xlw;.xlsx"/> </MimeTypes> </Settings>
In the dictionary, where the key is a separate extension and the value is a mimetype type.
So for this line:
<MimeType Type="application/vnd.ms-excel" Extensions=".xla;.xlc;.xlm;.xls;.xlt;.xlw;.xlsx"/>
I would have the following key values:
Key: ".xla" Value: "application / vnd.ms-excel"
Key: ".xlc" Value: "application / vnd.ms-excel"
Key: ".xlm" Value: "application / vnd.ms-excel"
Key: ".xls" Value: "application / vnd.ms-excel"
Key: ".xlt" Value: "application / vnd.ms-excel"
I am relatively new to the LINQ-To-XML business.
I know that I have to load the document in XElement, for example:
XElement settingsDoc = XElement.Load("Settings.xml");
However, how do I select all the "MimeType" entries?
source share