下面是我的 xml 文档的结构。我只想先获取每个节点的值,<attribute name="a">
然后将其与给定值进行比较。但是我不知道如何<attribute name="a">
在 c# 中使用 xml selectnodes 来定位每个节点。谷歌搜索没有显示任何有效的解决方案。
<nodes>
<node name = "node1">
<attribute name="a">This is node1 a</attribute>
<attribute name="b">This is node1 b</attribute>
</node>
<node name = "node2">
<attribute name="a">This is node2 a</attribute>
<attribute name="b">This is node2 b</attribute>
</node>
...
</nodes>