XML publishing provides a way to transform results of SQL queries into XML structures.
When you publish an XML document using the built-in XML publishing functions, you transform the result set of an SQL query into an XML structure, optionally including an XML schema and header. You can store the XML in the database server for use in XML-based applications.
The input XML must be in nested elements within an XML document, with each column being an XML element rather than an attribute. This format is sometimes called the FOR XML AUTO, ELEMENTS format.
The genxmlschema function and other XML publishing functions cannot publish BYTE or TEXT columns into an XML document. These functions take the input column as ROW types and then publish them. BYTE and TEXT are not allowed in ROW types, so cannot be used in these publishing functions.
ROW types are unsupported in distributed queries. These functions use ROW types. As a result, these publishing functions cannot be used in distributed queries or use a synonym referring to a non-local object.
EXECUTE PROCEDURE ifx_allow_newline('t');
EXECUTE PROCEDURE ifx_allow_newline('t');
CREATE DATABASE demo_xml IN datadbs with log;
CREATE TABLE tab (col2 lvarchar);
INSERT INTO tab VALUES ('
<personnel>
<person id="Jason.Ma">
<name>
<family>Ma</family>
<given>Jason</given>
</name>
</person>
</personnel>');