I am trying to get a list of all element nodes that have a child of <min value="1" /> and do not have a child of <mustSupport value="true" />.
Both of these 2 queries work separately,
//differential/element[child::min[@value='1'] ]
//differential/element[not (child::mustsupport)]
but produce no results when combined.
//differential/element[child::min[@value='1'] and not [child::mustsupport] ]
Not sure if it's a typo, but you have [ ] instead of ( ) on your not.
Also, xpath is case sensitive.
Lastly, the child:: axis is not necessary (although it's fine if it makes it easier to understand).
Try this...
//differential/element[min[@value='1'] and not(mustSupport[@value='true'])]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With