When the current() function is called in a predicate of
a pattern, other than a predicate in the last step of
the pattern, it returns the wrong node. Specifically,
it returns the node being matched by that step of the
pattern rather than the node being matched by the
pattern as a whole.
For example, the pattern
should match all elements that have the same name as
their parent element. In fact it matches all elements
that have a parent element, because the predicate
name()=name(current()) always evaluates to true.
This bug is present in 8.4 and all known previous
releases since the current() function was allowed in
No source patch is available since the design changes
to fix this are quite extensive. Test case: cnfr30.