[xquery-talk] Functional XPath commands

Liam R E Quin liam at w3.org
Sat Jan 25 23:24:02 PST 2014

On Sun, 2014-01-26 at 05:53 +0000, Ihe Onwuka wrote:
> 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.

> > if (@firstpage eq 0) then floor($totalPagesDecimal) else
> > ceiling($totalPagesDecimal)

The XPath engine does not know that @firstpage is an integer - unless
it's schema-aware and you supplied a schema, perhaps.

if (@firstpage treat as xs:integer eq 0)
might be one way round it.


Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

More information about the talk mailing list