Static function calls

A static function call consists of the name of the function and of expressions returning its parameters. An error is thrown if no function with the corresponding name and arity is found.

Example 70. A builtin function call.

       keys({ "foo" : "bar", "bar" : "foo" })

Result: foo bar

Example 71. A builtin function call.

       concat("foo", "bar")

Result: foobar

An error is raised if the actual types do not match the expected types.

Example 72. A type error in a function call.

       sum({ "foo" : "bar" })

Result: 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)

JSONiq static function calls follow the W3C specification.

Figure 39. FunctionCall