【发布时间】:2013-08-30 02:58:21
【问题描述】:
我正在尝试从以下位置提取<str> 标签的内容:
<lst name="Stack">
<lst name="Overflow">
<arr name="content">
<str>Help</str>
</arr>
</lst>
</lst>
我在 C# 中使用的代码是:
txtResponse.Text += xDoc.Descendants("lst")
.Where(f => (string) f.Attribute("name") == "Overflow")
.Descendants("arr")
.Descendants("str")
.Select(b => b.Value);
但它会回到我身边
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String]
我的问题是什么?
【问题讨论】:
-
你之前的问题已经有了答案:stackoverflow.com/questions/18462349/…
-
上一个问题类似但有细微差别