Project

Profile

Help

Cannot compare xs:string to xs:integer

Added by Anonymous almost 20 years ago

Legacy ID: #2917442 Legacy Poster: marcvc (marcvc)

Michael, I think this one is new to Saxon 8.2, it works in Saxon 8.1.1, consider the following xquery: declare function local:foo($v as item()) { $v > 0 } ; local:foo(<e>100</e>) Saxon reports a "Cannot compare xs:string to xs:integer" error. Thanks, Marc


Replies (1)

RE: Cannot compare xs:string to xs:integer - Added by Anonymous almost 20 years ago

Legacy ID: #2917835 Legacy Poster: Michael Kay (mhkay)

Thanks. I have described the bug, and given a source fix, at http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1093719&amp;group_id=29872&amp;atid=397617 The bug is not actually new in 8.2, but the incorrect optimization gets invoked in 8.2 because Saxon-B is now (correctly) inferring a cardinality of exactly one for the result of atomizing a node, on the basis that a node can never be list-valued in the absence of a schema. In 8.1.1 the cardinality was calculated as "zero or more" so the (incorrect) optimization was not performed in this case. Michael Kay

    (1-1/1)

    Please register to reply