Post by Ihe Onwuka
Well (4,5 div 0) on Saxon gives 4. Hurray.
(4,5 div 0) in eXist gives divide by zero error. Boo.
So the answer seems to be it depends.
Correct, it's entirely implementation-dependent.
Saxon would fail on (4, 5 div 0, 6), but other products might return 6.
The rule (see the "Errors and Optimization" section of the spec) is (my precis) that a processor doesn't have to evaluate an expression if it doesn't need to know the value of that expression in order to deliver the final result, and in particular, it never needs to evaluate an expression merely in order to discover whether evaluating it throws an error.