如果我有一个这样的xml (片段):
<flowreferences>
<ref>123</ref>
<ref>563</ref>
<ref>902</ref>
<ref>674</ref>
<ref>295</ref>
<ref>887</ref>
<ref>371</ref>
</flowreferences>
<object1 id="123">
......
</object1>
<object1 id="563">
......
</object2>
<object2 id="887">
......
</object2>
<object3 id="674">
......
</object3>
<object4 id="295">
......
</object4>
<object5 id="907">
......
</object5>
<object6 id="371">
......
</object6>是否有Xpath查询返回仅给定属性值的对象节点?换句话说,如果我知道id值(907),我如何找到object5节点?
发布于 2019-03-28 09:51:39
此XPath将选择id属性值为"907"的所有object5元素
//object5[@id="907"]此XPath将选择id属性值为"907"的所有元素
//*[@id="907"]https://stackoverflow.com/questions/55388979
复制相似问题