Support #6119


Advice on tracking down log warning

Added by John Cotton 12 months ago. Updated 12 months ago.

Start date:
Due date:
% Done:


Estimated time:
Applies to JS Branch:
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Contact person:
Additional contact persons:


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?

Regards John

Actions #1

Updated by Michael Kay 12 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 $X is xs:integer* while the inferred type of $Y is xs:string*. The message is telling you that the expression will fail with a dynamic error, except in the special case where either $X or $Y is an empty sequence (in which case it will return false).

Actions #2

Updated by John Cotton 12 months ago

Thanks Michael.

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.

Regards John

PS Slightly in awe to get a reply from you! You're Wrox XSLT guides have been programming companions for more than 20 years.

Actions #3

Updated by Michael Kay 12 months ago

  • Project changed from Saxon to SaxonJS

Please register to edit this issue

Also available in: Atom PDF Tracking page