This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Although the test fn:count(() is 100) permits a type checking error, it also permits the result 0. However, the rules for evaluating this state that: 1. The operands of a node comparison are evaluated in implementation-dependent order. 2. Each operand must be either a single node or an empty sequence; otherwise a type error is raised [err:XPTY0004]. 3. If either operand is an empty sequence, the result of the comparison is an empty sequence, and the implementation need not evaluate the other operand or apply the operator. However, an implementation may choose to evaluate the other operand in order to determine whether it raises an error. My reading of this is that (2) ensure that an error is raised before reaching stage (3). If this is not the case, should the order of (2) and (3) not be switched for clarity?
I believe that this test case is correct and section 3.5.3, Node Comparisons, should be changed in the way that you suggest. I will resolve this bug report when the WGs consider this change.
The WGs considered this in http://www.w3.org/Bugs/Public/show_bug.cgi?id=3733 and agreed to make the change to the order of the rules that you suggested. As such, I am not making any change to this test case. Please mark this bug report closed if you agree with this resolution.
Thanks.