This example used another function - ends-with()
- that's new in XPath 2.0. We are calling it inside a predicate (the expression between the square brackets), which defines a condition that nodes must satisfy in order to be selected. This XPath expression has two parts: a path .//actors/actor
that indicates which elements we are interested in, and a predicate [ends-with(., `Lisa')]
that indicates a test that the nodes must satisfy. The predicate is evaluated once for each selected element; within the predicate, the expression ".
" (dot) refers to the node that the predicate is testing, that is, the selected actor.