You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add XMLSerialize: version and explicit XML declaration
* Explicit XML declaration (SQL/XML:2023, X078)
This patch adds the options INCLUDING XMLDECLARATION and
EXCLUDING XMLDECLARATION to XMLSERIALIZE, allowing users
to explicitly control the presence of the XML declaration
(e.g., <?xml version="1.0" encoding="UTF-8"?>) in the
serialized output of XML values. If neither option is
specified, the output includes the declaration only if the
input XML value already contained one.
* Version support (SQL/XML:2023, X076)
The VERSION option allows specifying the version string
to use in the XML declaration. If specified, the version
must conform to the lexical rules of the XML standard,
e.g., '1.0' or '1.1'. If omitted or NULL, version '1.0'
is assumed.
In DOCUMENT mode, the version string is validated by
libxml2’s `xmlNewDoc()`, which will raise an error for
invalid versions and a warning for unsupported ones.
No validation is performed in CONTENT mode. This option
has no effect unless INCLUDING XMLDECLARATION is also
specified or the input XML value already contains a
declaration.
Examples:
SELECT xmlserialize(
DOCUMENT xmlval AS text
VERSION '1.0'
INCLUDING XMLDECLARATION);
SELECT xmlserialize(
DOCUMENT xmlval AS text
EXCLUDING XMLDECLARATION);
This patch also includes regression tests and documentation.
0 commit comments