Xpath 表达式如何检索给定节点的所有属性名称(而不是属性值!)? xml标签?
假设以下 XML 文档:
<bookstore>
<book>
<title lang="eng">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="fr" type="easyreading">Monsieur Claude</title>
<price>39.95</price>
</book>
</bookstore>
Xpath//title/@* 会选择“eng, fr, easyreading”,但哪个 Xpath 会选择“lang, lang, type”?
最佳答案
关于xpath - 使用 Xpath 获取属性名称(不是属性值),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55619752/