如何定位文檔中的所有元素,但是是特定的元素名稱?XPath獲取除具有特定名稱的所有子元素嗎?
例如,我想排除terminate
元素。它們可以發生在整個文件中。
<root>
<terminate attr="1" />
<other>
The brown fox jumps over the fence.
<terminate>
<b>stuff</b>
</terminate>
</other>
</root>
我使用not(..)
操作沒有成功可能是因爲我使用的是錯誤的嘗試。
坦率地試圖谷歌'不'很難!
要選擇* *所有的元素,在文檔中的任意位置,使用這樣的:'// * [不(個體經營::一)]' – jpadvo 2013-11-04 20:06:50
「我不能自行終止」=) – roryok 2015-01-30 15:38:15