Where $node-set is bound to a node-set having two or more nodes, and $string bound to a string, evaluating an expression will return a boolean true, if:
$node-set = $string- there is a node in $node-set that is equal to $string
$node-set != $string- there is a node in $node-set that is not equal to $string
not($node-set = $string)- there is not a node in $node-set that is equal to $string
not($node-set != $string)- there is not a node in $node-set that is not equal to $string
How parenthesis change expression evaluation:
descendant::*[1]or(descendant::*)[1]- Closest descendant element
descendant::*[last()]or(descendant::*)[last()]- Most distant descendant element
ancestor::*[1]or(ancestor::*)[last()]- Closest ancestor element
ancestor::*[last()]or(ancestor::*)[1]- Most distant foo ancestor element
Rewrites of some expressions I've seen in stylesheets to eliminate the last() function.
(ancestor::*/@role)[last()] = 'child' | ⇒ | ancestor::*[@role][1]/@role = 'child' |
| ⇒ | |