Re: [PATCH] Add pretty-printed XML output option

From: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Smith <smithpb2250(at)gmail(dot)com>, Andrey Borodin <amborodin86(at)gmail(dot)com>
Subject: Re: [PATCH] Add pretty-printed XML output option
Date: 2023-02-22 07:05:38
Message-ID: CANNMO+Kix1DRRa7m4o07qgRHh=0vOiO_x+_PsHOkQvT4GgLrLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 20, 2023 at 3:06 PM Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> wrote:

> As suggested by Peter and Nikolay, v15 now removes the xmlformat
> function from the catalog and adds the [NO] INDENT option to
> xmlserialize, as described in X069.\
>

Great. I'm checking this patch and it seems, indentation stops working if
we have a text node inside:

gitpod=# select xmlserialize(document '<xml><more>13</more></xml>' as text
indent);
xmlserialize
----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>+
<xml> +
<more>13</more> +
</xml> +

(1 row)

gitpod=# select xmlserialize(document '<xml>text<more>13</more></xml>' as
text indent);
xmlserialize
----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>+
<xml>text<more>13</more></xml> +

(1 row)

Worth to mention, Oracle behaves similarly -- indentation doesn't work:
https://dbfiddle.uk/hRz5sXdM.

But is this as expected? Shouldn't it be like this:
<xml>
text
<more>13</more>
</xml>
?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2023-02-22 07:20:04 Re: [PATCH] Add pretty-printed XML output option
Previous Message Hayato Kuroda (Fujitsu) 2023-02-22 07:01:28 RE: Allow logical replication to copy tables in binary format