Re: [PATCH] Add pretty-printed XML output option
Jim Jones <jim.jones@uni-muenster.de>
From: Jim Jones <jim.jones@uni-muenster.de>
To: Nikolay Samokhvalov <samokhvalov@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Peter Smith <smithpb2250@gmail.com>, Andrey Borodin <amborodin86@gmail.com>
Date: 2023-02-22T09:15:50Z
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
Commits
-
Fix memory leak in XMLSERIALIZE(... INDENT).
- f24605e2dc16 18.0 landed
- ee58de10084b 16.10 landed
- 20bae0690322 17.6 landed
-
doc: Move documentation of md5_password_warnings to a better place
- f3622b64762b 18.0 cited
-
Support [NO] INDENT option in XMLSERIALIZE().
- 483bdb2afec9 16.0 landed
-
Add an expected-file to match behavior of latest libxml2.
- 085423e3e326 9.6.0 cited