From 483bdb2afec9e33ff05fd48a00e2656e30e714b7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 15 Mar 2023 16:58:59 -0400 Subject: Support [NO] INDENT option in XMLSERIALIZE(). This adds the ability to pretty-print XML documents ... according to libxml's somewhat idiosyncratic notions of what's pretty, anyway. One notable divergence from a strict reading of the spec is that libxml is willing to collapse empty nodes "" to just "", whereas SQL and the underlying XML spec say that this option should only result in whitespace tweaks. Nonetheless, it seems close enough to justify using the SQL-standard syntax. Jim Jones, reviewed by Peter Smith and myself Discussion: https://postgr.es/m/2f5df461-dad8-6d7d-4568-08e10608a69b@uni-muenster.de --- src/include/utils/xml.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include/utils/xml.h') diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h index 311da06cd6f..224f6d75ffd 100644 --- a/src/include/utils/xml.h +++ b/src/include/utils/xml.h @@ -77,7 +77,8 @@ extern xmltype *xmlparse(text *data, XmlOptionType xmloption_arg, bool preserve_ extern xmltype *xmlpi(const char *target, text *arg, bool arg_is_null, bool *result_is_null); extern xmltype *xmlroot(xmltype *data, text *version, int standalone); extern bool xml_is_document(xmltype *arg); -extern text *xmltotext_with_xmloption(xmltype *data, XmlOptionType xmloption_arg); +extern text *xmltotext_with_options(xmltype *data, XmlOptionType xmloption_arg, + bool indent); extern char *escape_xml(const char *str); extern char *map_sql_identifier_to_xml_name(const char *ident, bool fully_escaped, bool escape_period); -- cgit v1.2.3