http://jsoniq.org/function-library

View as XML or JSON.

This module provides the functions defined by the JSONiq specification, chapter 8 (Function Library). JSONiq extends the XQuery specification to also deal with JSON data natively.

Function Summary

accumulate ($items as item()*) as object()

This function dynamically builds an object, like the {||} syntax, except that it does not throw an error upon pair collision.

descendant-arrays ($items as item()*) as array()*

This function returns all arrays contained at any depth within a sequence of items.

descendant-objects ($items as item()*) as object()*

This function returns all objects contained at any depth within a sequence of items.

descendant-pairs-priv ($i as item()) as object()*

Helper function for libjn:descendant-pairs()

descendant-pairs ($items as item()*) as object()*

This function returns all pairs contained at any depth within an sequence of items.

intersect ($items as item()*) as object()

This function returns the intersection of the objects contained in the given sequence of items, aggregating values corresponding to the same key into an array.

values ($items as item()*) as item()*

This functions returns all values of all objects contained in a sequence of items.

Functions

accumulate#1

declare  function libjn:accumulate($items as item()*) as object()
This function dynamically builds an object, like the {||} syntax, except that it does not throw an error upon pair collision. Instead, it accumulates them into an array, if more than one.

Parameters

items as item()
A sequence of items, the objects of which are going to be accumulated into a single object.

Returns

object()
The accumulated object.

descendant-arrays#1

declare  function libjn:descendant-arrays($items as item()*) as array()*
This function returns all arrays contained at any depth within a sequence of items.

Parameters

items as item()
A sequence of items.

Returns

array()*
The descendant arrays of the input sequence.

descendant-objects#1

declare  function libjn:descendant-objects($items as item()*) as object()*
This function returns all objects contained at any depth within a sequence of items.

Parameters

items as item()
A sequence of items.

Returns

object()*
The descendant objects of the input sequence.

descendant-pairs-priv#1

declare  function libjn:descendant-pairs-priv($i as item()) as object()*
Helper function for libjn:descendant-pairs()

Parameters

i as item()
An item

Returns

object()*
The descendant pairs of the item

descendant-pairs#1

declare  function libjn:descendant-pairs($items as item()*) as object()*
This function returns all pairs contained at any depth within an sequence of items.

Parameters

items as item()

Returns

object()*
All direct and indirect descendant pairs.

intersect#1

declare  function libjn:intersect($items as item()*) as object()
This function returns the intersection of the objects contained in the given sequence of items, aggregating values corresponding to the same key into an array.

Parameters

items as item()
A sequence of items.

Returns

object()
The insersection of the objects contained in $items.

values#1

declare  function libjn:values($items as item()*) as item()*
This functions returns all values of all objects contained in a sequence of items.

Parameters

items as item()
A sequence of items.

Returns

item()*
The values inside the objects of the sequence.