I can't quite get my query correct. Given this XML:
<?xml version="1.0" encoding="utf-8" ?>
<FileTypes>
<File type="photo">
<Extension>.jpg</Extension>
<Extension>.gif</Extension>
</File>
<File type="document">
<Extension>.pdf</Extension>
</File>
<File type="video">
<Extension>.flv</Extension>
</File>
</FileTypes>
I would like to extract the extensions to a string array for a given file type. This is what I have so far:
var query = from m in _UploadFileTypes.Elements("FileTypes").Elements("File")
where m.Attribute("type").Value.ToUpper() == fileTypeFilter
select m.Elements("Extension");
foreach (var item in query)
{
//item.ToString() does not yield the correct value...
}
Any help would be greatly appreciated!