XPath expression :
$countryCode='104' and (transactionType!='Allowance' or revenueCenter!='1100')
is syntactically correct .
We cannot say anything about semantics, since an XML document is not provided, and there is no explanation of which expression should choose.
As usual, there is a recommendation not to use the != Operator, if it is really necessary - its use when one of the arguments is node-set (or a sequence or node-set in XPath 2.0) is very far from what most people expect.
Instead of != better to use the not() function:
$countryCode='104' and (not(transactionType='Allowance') or not(revenueCenter='1100'))
and this can be reorganized into shorter and equivalent:
$countryCode='104' and not(transactionType='Allowance' and revenueCenter='1100')
Dimitre novatchev
source share