Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
For example, the expression:
//book[author=“Kay”]
means the same as:
//book[some $a in author satisfies $a eq “Kay”]
Similarly, the expression:
//book[author=(“Kay”, “Tennison”, “Carlisle”)]
means the same as:
//book[some $a in author,
$s in (“Kay”, “Tennison”, “Carlisle”)
satisfies $a eq $s]
It's a matter of personal style which one you choose in these cases. However, if the operator is something more complex than straight equality—for example, if you are comparing the two values using the
compare()
function with a non-default collation—then the only way to achieve the effect within XPath is to use a
some
or
every
expression.
Errors in
some
and
every
Expressions
Dynamic (runtime) errors can occur in
some
and
every
expressions just as in any other kind of XPath expression, and the rules are the same. But for these expressions the rules have some interesting consequences that are worth exploring.
Let's summarize the rules here: