【发布时间】:2013-08-28 15:20:00
【问题描述】:
请帮助我解决下面提到的具有 xml 的场景,我想要 C# LINQ 中的代码
<?xml version="1.0" encoding="utf-8" ?>
<root>
<Countries>
<Country name="India">
<state id="1"> Tamilnadu</state>
<state> Karnataka</state>
</Country>
<Country name="America">
<state id="1"> WI</state>
<state> AW </state>
</Country>
<Country name="Africa">
<state id="1"> Melbourne</state>
<state> sydney </state>
</Country>
</Countries>
</root>
如何通过 LINQ 获取属性 id=1 的状态,因为我能够获取属性 name="India"?以及如何给出 id=1 我的意思是没有“1”的数值
【问题讨论】: