Hi Max,

Thanks for your report.

The behavior is correct, but I agree it’s surprising:

• //* returns two results: <a.../> and <C:A.../>
• the atomized value of <a.../> is '14588204311438466813'. This value exceeds the BaseX limit for integers (2^64), which is why [not(. castable as xs:integer)] returns true for this element.
• the atomized value of <C:A.../> is 1458820431. This value can be represented as xs:integer, so – as expected – [not(. castable as xs:integer)] reurns false.

If you want to want to check for numbers that exceed the 2^64 limit, you can use xs:decimal tests. If you want to check if the single text nodes are integers, you can use:

//text()[not(. castable as xs:integer)]

Hope this helps,
Christian