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

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
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 09:15:50
Message-ID: 39c309eb-389b-4b20-47cd-a9f41e25dbc4@uni-muenster.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 22.02.23 08:05, Nikolay Samokhvalov wrote:
>
> But is this as expected? Shouldn't it be like this:
> <xml>
>   text
>   <more>13</more>
> </xml>
> ?

Oracle and other parsers I know also do not work well with mixed
contents.[1,2] I believe libxml2's parser does not know where to put the
newline, as mixed values can contain more than one text node:

<xml>text<more>13</more> text2 text3</xml> [3]

And applying this logic the output could look like this ..

<xml>text
  <more>13</more>text2 text3
</xml>

or even this

<xml>
  text
  <more>13</more>
  text2 text3
</xml>

.. which doesn't seem right either. Perhaps a note about mixed contents
in the docs would make things clearer?

Thanks for the review!

Jim

1- https://xmlpretty.com/

2- https://www.samltool.com/prettyprint.php

3- https://dbfiddle.uk/_CcC8h3I

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2023-02-22 09:18:57 Re: refactoring relation extension and BufferAlloc(), faster COPY
Previous Message Peter Eisentraut 2023-02-22 09:14:05 Re: meson: Non-feature feature options