This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The semantics for equality testing of strings (fs:eq(string,string)) appears to be wrong (http://www.w3.org/TR/2005/CR-xquery-semantics-20051103/#sec_operators): fs:eq(A as xs:string, B as xs:string) --> op:numeric-equal(fn:compare(A, B), 1) fn:compare(string,string), however, is supposed to return 0 (not 1) if both arguments are equal. fs:ne() has the analogous problem.
I agree this is a bug, and a good catch at that. The following two lines in the operators mapping table: fs:eq(A, B) | xs:string | xs:string | op:numeric-equal(fn:compare(A, B), 1) ... and fs:ne(A, B) | xs:string | xs:string | fn:not(op:numeric-equal(fn:compare(A, B), 1)) ... should be changed to: fs:eq(A, B) | xs:string | xs:string | op:numeric-equal(fn:compare(A, B), 0) ... and fs:ne(A, B) | xs:string | xs:string | fn:not(op:numeric-equal(fn:compare(A, B), 0) ... respectively. Thanks for the comment. - Jerome
This is the official response from the XML Query WG and the XSL WG. The solution proposed in comment #1 was agreed and will be made to the Formal Semantics document. Consequently, this bug is marked as FIXED. If this meets with your approval, you should mark the bug CLOSED. If the bug is not marked CLOSED and we do not receive a response from you within two weeks, then we will assume that you do not object and we will mark the bug CLOSED.
Thanks for fixing this. The solution seems ok to me.