Gavlos
Gavlos

Reputation: 287

XPath logical expression

I have a simple expression:

*[local-name() = 'test' and namespace-uri() = 'test1' or namespace-uri() = 'test2']"

This is something like:

 (x and y) or z

How to create the following expression:

x and (y or z)

I am using XPath 2.0

Upvotes: 1

Views: 44

Answers (1)

Siebe Jongebloed
Siebe Jongebloed

Reputation: 4870

Try:

*[local-name() = 'test' and (namespace-uri() = 'test1' or namespace-uri() = 'test2')]"

or

*[local-name() = 'test' and namespace-uri() = ('test1','test2')]"

Upvotes: 1

Related Questions