[xquery-talk] divide by zero

Michael Kay mhk at mhk.me.uk
Thu May 25 14:14:58 PDT 2006

> { if (count($paths[.=$papa]) = 0) then let $rat:=1 else let 
> $rat:=count($paths[.=$papa]) return

That's declaring two separate variables, each with the same name, which
immediately go out of scope. You need

let $rat := (if (xxxx = 0) then 1 else (xxxx))

Michael Kay

More information about the talk mailing list