Hi, I'm Shuxin. Recently I came across this test case in which BaseX returned counterintuitive result. From my feelings it seems like a bug but the behavior of Saxon is similar, and therefore is hard for me to confirm. Give XML document
<P1 id="1"><A1 id="2">1</A1><A1 id="3">1</A1>1</P1> and XPath query //*[boolean(.) cast as xs:double] Both Saxon and BaseX return the result node set [1, 2]. However, the nodes with id 2 and 3 seems identical to me and is hard to understand why node 2 is selected while 3 is not. If node 2 is deleted from the XML document, result set [1,3] is returned. I'm interested in whether this is intended behavior which I might have limited knowledge of? If it is also of interest for you you may have a look. Thank you very much! Best Regards, Shuxin Li 2023.5.23