Hi all,
I'm trying to control the behaviour of a xform trigger by evaluating some values from an XML instance like this:
<xforms:setvalue ref="instance('query-parameters')/parameters:page" value="if (instance('query-response')//rsp:page < instance('query-response')//rsp:totalPages)......
This doesn't work as expected; the < seems to do a lexicographic comparison of both values.
For example, if instance('query-response')//rsp:totalPages evaluates to 63, then (by the < operator) 6 is considered less, but 7 is considered greater.
How can I do a proper numeric comparison?
Best, Robin -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi Robin,
> <xforms:setvalue ref="instance('query-parameters')/parameters:page" > value="if (instance('query-response')//rsp:page < > instance('query-response')//rsp:totalPages)...... > This doesn't work as expected; the < seems to do a lexicographic > comparison of both values. > For example, if instance('query-response')//rsp:totalPages evaluates to > 63, then (by the < operator) 6 is considered less, but 7 is > considered greater. > How can I do a proper numeric comparison? you could try to convert the xpath result explicitly to an numeric value using number(): "if (number(instance('query-response')//rsp:page) lt number(instance('query-response')//rsp:totalPages)) ..." HTH florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hello Florian,
Thanks, that works like a charm!
Best, Robin -----Original message----- -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |