Prolog

The prolog is series of declarations that define the processing environment for a query. Each declaration in the prolog is followed by a semicolon (;). The prolog is an optional part of the query; a valid query can consist of a query body with no prolog.

The prolog includes an optional version declaration, namespace declarations, and setters, which are optional declarations that set the values of properties that affect query processing.

Db2 XQuery supports the boundary-space declaration that can be used to change how the query is processed. The prolog also consists of namespace declarations and default namespace declarations.

Db2 XQuery also supports the following setters. However, they do not change the processing environment because Db2 XQuery supports only one option in each case:
  • Construction declaration
  • Copy-namespaces declaration
  • Empty order declaration
  • Ordering mode declaration

The version declaration, if present, must be first in the prolog. Setters and other declarations can appear in any order in the prolog after the version declaration.

Syntax

Read syntax diagramSkip visual syntax diagramVersion declaration1Boundary-space declarationConstruction declarationCopy-namespaces declarationEmpty order declarationDefault element/type namespace declarationDefault function namespace declarationNamespace declarationOrdering mode declaration
Notes:
  • 1 Each declaration can be specified only once, except for the namespace declaration.