Static function calls

JSONiq follows the W3C standard for static function calls. The following explanations, provided as an informal summary for convenience, are non-normative.

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 71. A builtin function call.

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

Result: foo bar

Example 72. A builtin function call.

       concat("foo", "bar")

Result: foobar

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

Example 73. 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