[PATCH] Add pretty-printed XML output option - Mailing list pgsql-hackers

From Jim Jones
Subject [PATCH] Add pretty-printed XML output option
Date
Msg-id 2f5df461-dad8-6d7d-4568-08e10608a69b@uni-muenster.de
Whole thread Raw
Responses Re: [PATCH] Add pretty-printed XML output option
Re: [PATCH] Add pretty-printed XML output option
List pgsql-hackers
Hi,

This small patch introduces a XML pretty print function. It basically 
takes advantage of the indentation feature of xmlDocDumpFormatMemory 
from libxml2 to format XML strings.

postgres=# SELECT xmlpretty('<foo id="x"><bar id="y"><var 
id="z">42</var></bar></foo>');
         xmlpretty
--------------------------
  <foo id="x">            +
    <bar id="y">          +
      <var id="z">42</var>+
    </bar>                +
  </foo>                  +

(1 row)


The patch also contains regression tests and documentation.

Feedback is very welcome!

Jim

Attachment

pgsql-hackers by date:

Previous
From: Nikolay Samokhvalov
Date:
Subject: Re: Amcheck verification of GiST and GIN
Next
From: Peter Geoghegan
Date:
Subject: Re: Amcheck verification of GiST and GIN