【发布时间】:2010-12-13 14:39:38
【问题描述】:
我有这个 xml
<config>
<audio first="true" second="false" third="true" />
</config>
我希望我的代码能够做这样的事情
if (xdoc.getAttr("first")=="true")
Console.Write("first is true");
如何使用 LINQ XDocument 执行此操作? 到目前为止,我所拥有的是加载了该 xml 字符串的 XDocument 对象。
【问题讨论】:
-
我会回答,但这将是多余的。您要执行的操作在 XElement 中。
-
@Slaks,我做了,但我找不到我要找的东西,@legatou 我会看看 XElement。
标签: c# xml linq linq-to-xml