I have simple XML which I would like to query for mnemonic collection.
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<logs version="1.3.1.1" xmlns="http://www.witsml.org/schemas/131">
    <log>
        <startIndex uom="m">200.29</startIndex>
        <endIndex uom="m">209.73</endIndex>
        <logCurveInfo>
            <mnemonic>DEPTH</mnemonic>
        </logCurveInfo><logCurveInfo>
            <mnemonic>VDEPTH</mnemonic>
        </logCurveInfo>
        <logCurveInfo>
            <mnemonic>ropAv1</mnemonic>
        </logCurveInfo>
        <logCurveInfo>
            <mnemonic>wobAv1</mnemonic>
        </logCurveInfo>
        <logCurveInfo>
            <mnemonic>hkldAv1</mnemonic>
        </logCurveInfo>
        <logData>
            <data />
        </logData>
    </log>
</logs>
I have tried with,
XDocument xDoc = XDocument.Load(@"e:\sampleXml.xml");
var q = from c in xDoc.Descendants("logCurveInfo")
        select c.Element("mnemonic").Value;
foreach (string item in q)
{
    MessageBox.Show(item);
}
Though the query is getting executed, but I am not getting anything as output. I expect each mnemonic to be shown on the messagebox in the loop.
 
     
    