Product SiteDocumentation Site

1.2. Structure of a JSONiq program.

Module
Figure 1.1. Module

MainModule
Figure 1.2. MainModule

A main JSONiq program is made of two parts: an optional prolog, and an expression, which is the main query.
The result of the main JSONiq program is the result of its main query.
In the prolog, it is possible to declare global variables and functions. Mostly, you will recognize a prolog declaration by the semi-colon it ends with. The main query does not contain semi-colons (at least in core JSONiq).
LibraryModule
Figure 1.3. LibraryModule

Library modules do not contain any main query, just global variables and functions. They can be imported by other modules.