The reason is that the borb operator isnbt exactly what you think it
might be, in this specific context. borb is a Boolean borb, not a set
union. In XSLT2 the set union operator over nodes is b|b, which removes
duplicates (that is the same node referenced more than once.
So you need count(ancestor::li | ancestor::step)
John Lumley
john@xxxxxxxxxxxxxx
> On 2 Oct 2026, at 16:04, Trevor Nicholls trevor@xxxxxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> ancestor::li or ancestor::step
|