In https://github.com/jpcs/transform.xq/blob/master/lib/compile_pattern.xq#L66-L86, the 3rd parameter of fold-left() is provided as a node, but the 3.0 F&O spec for fold-left() states that the 3rd parameter should be of type function: https://www.w3.org/TR/xpath-functions-30/#func-fold-left.
I came across this when trying to run the sample scripts in eXist (current develop branch). The exact error:
Cannot compile xquery: exerr:ERROR XPTY0004/FOCH0002: Supplied argument 3 of function: fold-left($sequence as item()*, $zero as item()*, $function as function) item()* does not match required type. Required type function, got node(). [at line 70, column 7, source: /db/transform.xq-master/lib/compile_pattern.xq]
My guess is that your use of fold-left() was based on an earlier draft of the 3.0 F&O spec.
(The other issue I had to work around was renaming your map module's namespace prefix, as map is now reserved for http://www.w3.org/2005/xpath-functions/map. A quick rename to snelson-map worked though.)
Do you have any pointers for how to approach fixing the fold-left() issue? Thanks in advance.
In https://github.com/jpcs/transform.xq/blob/master/lib/compile_pattern.xq#L66-L86, the 3rd parameter of
fold-left()is provided as a node, but the 3.0 F&O spec forfold-left()states that the 3rd parameter should be of typefunction: https://www.w3.org/TR/xpath-functions-30/#func-fold-left.I came across this when trying to run the sample scripts in eXist (current develop branch). The exact error:
My guess is that your use of
fold-left()was based on an earlier draft of the 3.0 F&O spec.(The other issue I had to work around was renaming your
mapmodule's namespace prefix, asmapis now reserved forhttp://www.w3.org/2005/xpath-functions/map. A quick rename tosnelson-mapworked though.)Do you have any pointers for how to approach fixing the
fold-left()issue? Thanks in advance.