Advice on tracking down log warning
I'm processing '00s of XSL files (with the same XML input) with SaxonJS.
Many throw out this console log:
Cannot compare items of types xs:integer and xs:string: the comparison can succeed only if one of the values is an empty sequence.
It doesn't appear to prevent any output. However, it would be great to know what's causing it.
I've logged the code that's making the warning, but the data at that point is (I think) my "compiled" XSLT, so it's impossible to know where the issue is coming from.
Any advice on finding it?
Updated by Michael Kay 3 months ago
I'm afraid it's not very helpful, but immediately above the line that issues this message, there is a comment:
// TODO: how to issue warning messages? How to add location?
I can try to explain what the message means, but I can't tell where it comes from (though we might be able to find out if you send us a repro).
The message is produced at compile time, during static type checking, when there's an expression of the form
$X = $Y, where the inferred type of
xs:integer* while the inferred type of
xs:string*. The message is telling you that the expression will fail with a dynamic error, except in the special case where either
$Y is an empty sequence (in which case it will return false).
Updated by John Cotton 3 months ago
I went old school and pulled out chunks of code until the errors went away. It was indeed an "if test". Would be great if that ToDo could make it to the top of the pile since it's hard to track these things down otherwise without a lot of debugging.
PS Slightly in awe to get a reply from you! You're Wrox XSLT guides have been programming companions for more than 20 years.
Please register to edit this issue