0
我有以下XML。選擇一個包含LINQ to XML的元素
<logs version="1.3.1.1" xmlns="http://www.witsml.org/schemas/131">
<log uidWell="001" uidWellbore="001" uid="0c43e8df-ed63-41e4-878f-d1e5dd3b97d1">
<startIndex uom="m">200.29</startIndex>
<endIndex uom="m">209.73</endIndex>
<logCurveInfo>
<mnemonic>hkldAv1</mnemonic>
</logCurveInfo>
<logCurveInfo>
<mnemonic>DEPTH</mnemonic>
</logCurveInfo>
<logCurveInfo>
<mnemonic>wobAv1</mnemonic>
</logCurveInfo>
<logCurveInfo>
<mnemonic>ropAv1</mnemonic>
</logCurveInfo>
<logData />
</log>
</logs>
我想從XML中檢索元素<logData>
。
我試圖用,
XDocument xDoc = XDocument.Load(@"e:\data.xml");
XNamespace xmlns = "http://www.witsml.org/schemas/131";
XElement xlog = xDoc.Element(xmlns + "logData");
,但它是xlog
返回null。