The second one (focused()=true) is an error, since true by itself is undefined. The rest are equivalent, but yeah, having no RHS is less typing.
Note that any non-empty string is converted to true, so you could have focused()='0' or focused()='false' or even focused()='Jack Sparrow' and they would all be equivalent to true().
Only focused()=0 or focused()=false() or focused()='' or not(focused()) are really false.
XPath Syntax - which is best?
Noa
LouisVanAlphen
The second one (focused()=true) is an error, since true by itself is undefined. The rest are equivalent, but yeah, having no RHS is less typing.
Note that any non-empty string is converted to true, so you could have focused()='0' or focused()='false' or even focused()='Jack Sparrow' and they would all be equivalent to true().
Only focused()=0 or focused()=false() or focused()='' or not(focused()) are really false.
derekyeong
Stas Kravets