【发布时间】:2013-07-17 16:01:06
【问题描述】:
我在 VB.net 中使用带有以下 XML 的 XPath:
<bookstore>
<book>
<title lang="eng">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="eng">Learning XML</title>
<price>39.95</price>
</book>
<book>
<title>English-French Dictionary</title>
<price>29.95</price>
</book>
</bookstore>
根据this guide,很容易得到具有特定属性的节点列表。
//标题[@lang]
选择所有具有属性的标题元素 命名语言
但是你如何获得不具有特定属性的节点列表呢? (例如上面的第三本书,它没有lang 属性。)
【问题讨论】: