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
- db2dsdriver.cfg configuration syntax
- <parameter name="XMLDeclarationGenMode" value="non-negative
integer < 7 | 7"/>
- Default setting:
- A BOM and an XML declaration containing the XML version and encoding
attribute are generated during implicit serialization.
- Usage notes:
The XMLDeclaration keyword controls which elements of an XML
declaration are prepended to 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.
Set this keyword by adding together the value of each component 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 prepended
to the output buffer if the target encoding is UTF-16 or UTF-32.
(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. Therefore, this setting only has
effect when the setting of 2 is also included when computing the value
of this 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 XMLDeclaration
as follows: XMLDeclaration = 0.