Construction declaration
A construction declaration in the query prolog sets the construction mode for the query. The construction mode controls how type annotations are assigned to element and attribute nodes that are copied to form the content of a newly constructed node.
In Db2 XQuery, the construction mode for constructed element nodes is always strip. For Db2 XQuery, when the construction mode is strip, the type of a constructed element node is xdt:untypedAtomic; all element nodes copied during node construction receive the type xdt:untypedAtomic, and all attribute nodes copied during node construction receive the type xdt:untypedAtomic.
A construction declaration that specifies a value other than strip results in an error. The prolog can contain only one construction declaration for a query.
Syntax
- strip
- For Db2 XQuery, specifies the type of a constructed element node is xdt:untypedAtomic; all element nodes copied during node construction receive the type xdt:untypedAtomic, and all attribute nodes copied during node construction receive the type xdt:untypedAtomic.
Example
The following construction declaration is valid, but does not change the default behavior for element construction:
declare construction strip;