On 14 Mar 2014, at 14:32, Ihe Onwuka <[email protected]> wrote:

> Well (4,5 div 0)[1] on Saxon gives 4. Hurray.
> 
> (4,5 div 0)[1] 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)[3], 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.

Michael Kay
Saxonica


_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to