Combining Conditionals

Parent Previous Next

Combining conditionals

If we want to combine conditionals we can create a new single conditional in the form:

(<conditional>) <operator> (<conditional>)

The operator can be either && in order to require that both conditionals match, or || in order to require that at least one of the conditionals match. We can then combine these conditionals again. For example, if we wanted to find any objects that had a property called Test that was equal to ‘1’ or ‘2’ and a property called OtherTest that was equal to ‘3’, we could use the following path:

//*[((@Test==”1”) || (@Test==”2”)) && (@OtherTest==”3”)]