Re: xmlserialize bug - extra empty row at the end
От | Jim Jones |
---|---|
Тема | Re: xmlserialize bug - extra empty row at the end |
Дата | |
Msg-id | c3d5b8ba-156b-ed1e-67b3-c5934f51248a@uni-muenster.de обсуждение исходный текст |
Ответ на | xmlserialize bug - extra empty row at the end (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: xmlserialize bug - extra empty row at the end
Re: xmlserialize bug - extra empty row at the end |
Список | pgsql-hackers |
On 23.04.23 07:31, Pavel Stehule wrote: > Hi > > maybe I found a bug in xmlserialize > > SELECT xmlserialize(DOCUMENT '<foo><bar><val > x="y">42</val></bar></foo>' AS varchar INDENT); > > (2023-04-23 07:27:53) postgres=# SELECT xmlserialize(DOCUMENT > '<foo><bar><val x="y">42</val></bar></foo>' AS varchar INDENT); > ┌─────────────────────────┐ > │ xmlserialize │ > ╞═════════════════════════╡ > │ <foo> ↵│ > │ <bar> ↵│ > │ <val x="y">42</val>↵│ > │ </bar> ↵│ > │ </foo> ↵│ > │ │ > └─────────────────────────┘ > (1 row) > > Looks so there is an extra empty row. > > Regards > > Pavel Hi Pavel, Good catch! It looks like it comes directly from libxml2. xmlDocPtr doc = xmlReadDoc(BAD_CAST "<foo><bar><val x=\"y\">42</val></bar></foo>", NULL, NULL, 0 ); xmlBufferPtr buf = NULL; xmlSaveCtxtPtr ctxt = NULL; buf = xmlBufferCreate(); ctxt = xmlSaveToBuffer(buf, NULL, XML_SAVE_NO_DECL | XML_SAVE_FORMAT); xmlSaveDoc(ctxt, doc); xmlSaveClose(ctxt); printf("'%s'",buf->content); ==> '<foo> <bar> <val x="y">42</val> </bar> </foo> ' I'll do some digging to see if there is a good way to get rid of this newline or if we need to chose a different dump function. Thanks! Best, Jim
В списке pgsql-hackers по дате отправления: