Re: [BUG?] XMLSERIALIZE( ... INDENT) won't work with blank nodes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUG?] XMLSERIALIZE( ... INDENT) won't work with blank nodes
Дата
Msg-id 2294688.1725640444@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [BUG?] XMLSERIALIZE( ... INDENT) won't work with blank nodes  (Jim Jones <jim.jones@uni-muenster.de>)
Список pgsql-hackers
Jim Jones <jim.jones@uni-muenster.de> writes:
> mmh... xmlDocContentDumpOutput seems to add a trailing newline in the
> end of a document by default, making the serialization of the same xml
> string with DOCUMENT and CONTENT different:

Does seem a bit inconsistent.

> Or should we in this case consider something like this in
> xmltotext_with_options()?
> result = cstring_to_text_with_len((const char *) xmlBufferContent(buf),
> xmlBufferLength(buf) - 1);

I think it'd be quite foolish to assume that every extant and future
version of libxml2 will share this glitch.  Probably should use
logic more like pg_strip_crlf(), although we can't use that directly.

Would it ever be the case that trailing whitespace would be valid
data?  In a bit of testing, it seems like that could be true in
CONTENT mode but not DOCUMENT mode.

            regards, tom lane



В списке pgsql-hackers по дате отправления: