Comment 2 for bug 1064978

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

The current functionality is working but it assumes that the user knows before hand the type of the variable it wants to bind the value to.

I asked how hard would be to add a new signature that does not receive the type of the value, just the value.
If there is a type defined in the external variable, XQXQ should try to cast the passed value to that type.
If it does not succeed than raise an error.

Does it make sense?

One reason is that there are several tests in FOTS that declare an external variable with a type
[...]
declare variable $ext as xs:integer external := 0;
[...]

And then you are suppose to bind a value "2" given as string to that variable.

These types of test cases check if the binding of the variable is done after the variable declaration.
Meaning if in the end the value of the $ext is xs:integer(2).