This demonstrates a difference in behavior in saxon-js 2.4 vs saxon-js 2.5.

saxon-js 2.4

saxon-js 2.5