0
我有這樣的XPath(感謝伊恩·羅伯茨的答案SO Xpath2.0 selecting first and last occurance of string with iteration):的XPath替換FOR語句
Events/Properties[
count(
for $me in (Property[@Descriptor="200"]) return
(preceding-sibling::Properties[1][Property[@Descriptor="200"] = $me],
following-sibling::Properties[1][Property[@Descriptor="200"] = $me])
) != 2
]
的XPath是偉大的,但我使用的工具不接受for
聲明。
如何重寫此XPath以避免此問題[沒有for
聲明]?
第一批組:A組
//Properties[
Property/@Descriptor = 200
and not(
Property = preceding-sibling::*/Property[@Descriptor = 200]
)
]
最後的
那麼你使用的是什麼工具? – Tomalak
專有的報告工具...沒有與Xpath相關的規範是誠實的。只需使用XPath作爲選擇XML文檔中節點的方式。 –
所以我假設你想要一個XPath 1.0表達式,因爲如果你的工具在2.0上存在,那麼它可能不夠現代。 – Tomalak