Reputation: 1562
XML:
<codes>
<code>AP</code>
<code>BS</code>
</codes
I am trying to check <code>
if it contains both 'AP' and 'BS' using following xpath.
/codes[contains(code, 'AP') and contains(code, 'BS')]
but is not working. Is there any other way to get to the solution?
Upvotes: 0
Views: 2175
Reputation: 26153
If you really need contains
but not exactly equal
, use such Xpath
/codes[code[contains(., 'AP')] and code[contains(., 'BS')]]
Upvotes: 2