[xquery-talk] Functional XPath commands

Ihe Onwuka ihe.onwuka at gmail.com
Sat Jan 25 21:53:06 PST 2014


and it came to pass that the innocuous looking conditional in the  if
statement demands that @firstpage is cast to xs:integer before it will
work lest there be complaints of unTypedAtomic (or whatever it said)
comparisons with xs:integer.

What is the pourquoi of this. Why no type promotion (or is it
downcasting) in effect here. What could be simpler than comparing to
0.

Verily twas a tough spot, I went through every other conditional in
the program first because it looked to me like the least likely
suspect.

On Fri, Jan 24, 2014 at 1:14 PM, Ihe Onwuka <ihe.onwuka at gmail.com> wrote:
> So I have just written
>
> if (@firstpage eq 0) then floor($totalPagesDecimal) else
> ceiling($totalPagesDecimal)
>
> but how close would
>
> (floor,ceiling)[@firstpage + 1]($totalPagesDecimal) have been
>
> I'm guessing  I would at least have to put some function invoking
> paraphenalia around the calls to floor and ceiling (hopefully not).


More information about the talk mailing list