Error of data type

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error of data type

akail
Hi,

I have a problem with data type, for me is showing a error message, here my source: https://gist.github.com/anonymous/7889238

I set that control k1 and k2 is positive integer type, k3 and k4 is string type. I if is answer k1, than appears k2, if is answer k2 than appears k3 and so on.

Maybe You can tell me, where is problem, and how I can fix it?
Reply | Threaded
Open this post in threaded view
|

Re: Error of data type

Erik Bruchez
Administrator
Try instead:

    string($k2) = ''

    string($K3) != ''

The issue is that the values are numbers, and XPath doesn't allow treating them as strings implicitly. the string() function instead provides access to the raw string value, and the comparison then works.

-Erik