Product SiteDocumentation Site

5.3. Function Calls

FunctionCall
Figure 5.26. FunctionCall

The syntax for function calls is similar to many other languages. JSONiq supports three sorts of functions:
Example 5.61. A builtin function call.
     keys({ "foo" : "bar", "bar" : "foo" })
Result (run with Zorba):
foo bar

Example 5.62. A builtin function call.
     concat("foo", "bar")
Result (run with Zorba):
foobar

An error is raised if the actual types do not match the expected types.
Example 5.63. A type error in a function call.
     sum({ "foo" : "bar" })
Result (run with Zorba):
An error was raised: can not atomize an object item: an object has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item)