我有以下示例 XML 结构:
<SavingAccounts>
<SavingAccount>
<ServiceOnline>yes</ServiceOnline>
<ServiceViaPhone>no</ServiceViaPhone>
</SavingAccount>
<SavingAccount>
<ServiceOnline>no</ServiceOnline>
<ServiceViaPhone>yes</ServiceViaPhone>
</SavingAccount>
</SavingAccounts>
我需要做的是使用 XPATH 过滤“SavingAccount”节点,其中“ServiceOnline”的值为“yes”或“ServiceViaPhone”的值为“yes”。
XPATH 应该返回我两行!我可以过滤两个元素值都是“是”的“SavingAccount”节点,就像下面的 XPATH 示例一样,但我想要做的是或元素值比较???
/SavingAccounts/SavingAccount/ServiceOnline[text()='yes']/../ServiceViaPhone[text()='yes']/..