XMLDeclarationGenMode IBM data server driver configuration keyword
Controls the generation of an XML declaration when XML data is implicitly serialized to an application variable.
- Equivalent CLI keyword
- XMLDeclaration
- Equivalent IBM® data server provider for .NET connection string keyword
- N/A
- IBM data server driver configuration file (db2dsdriver.cfg) syntax
<parameter name="XMLDeclarationGenMode" value="0 | 1 | 2 | 3 | 4 | 5 | 6 | 7"/>
- Default setting:
- 7: A byte order mark (BOM) and an XML declaration that contains the XML version and encoding attribute are generated during implicit serialization.
- Usage notes:
The XMLDeclaration keyword controls which elements of an XML declaration are attached to the beginning of an application buffer when XML data is implicitly serialized to an application buffer. This setting does not affect the result of the XMLSERIALIZE function.
The following values represent components to be generated during implicit serialization. The XMLDeclaration keyword can be set by adding the value of each component that is required.- 0
- No declarations or byte order marks (BOMs) are added to the output buffer.
- 1
- A byte order mark (BOM) in the appropriate endianness is attached
to the beginning of the output buffer if the target encoding is UTF-16
or UTF-32. Remember: Although a UTF-8 BOM exists, the database server does not generate it, even if the target encoding is UTF-8.
- 2
- A minimal XML declaration is generated, containing only the XML version.
- 4
- An encoding attribute that identifies the target encoding is added to any generated XML declaration. This setting can take an effect only when the setting of 2 is also included when you are computing the value of the XMLDeclaration keyword.
For example, if you wanted a BOM and minimal XML declaration (without an encoding attribute) to be generated during implicit serialization, set
XMLDeclaration = 3
, where 3 is the sum of 1 (the value to indicate generation of a BOM) and 2 (the value to indicate generation of a minimal XML declaration).To prevent any declarations or BOM from being generated, set the XMLDeclaration keyword as follows:
XMLDeclaration = 0
.