xpath insert unexpected newlines
От | Voillequin, Jean-Marc |
---|---|
Тема | xpath insert unexpected newlines |
Дата | |
Msg-id | 1EC8157EB499BF459A516ADCF135ADCE3A23A9CA@LON-WGMSX712.ad.moodys.net обсуждение исходный текст |
Список | pgsql-sql |
Hello guys,
It seems that xpath function add unexpected newlines in the xml elements it returns as array:
postgres=> select version();
version
------------------------------------------------------------
PostgreSQL 10.3, compiled by Visual C++ build 1800, 64-bit
(1 row)
postgres=> select ((xpath('/*',xml('<root><a/><b/><c/></root>')))[1])::text;
xpath
---------
<root> +
<a/> +
<b/> +
<c/> +
</root>
(1 row)
A workaround is to have at least one element with a value:
postgres=> select ((xpath('/*',xml('<root><a/><b/><c/>one value</root>')))[1])::text;
xpath
------------------------------------
<root><a/><b/><c/>one value</root>
(1 row)
Best regards.
This email was sent to you by Moody’s Investors Service EMEA Limited
Registered office address:
One Canada Square
Canary Wharf
London, E14 5FA
Registered in England and Wales No: 8922701
В списке pgsql-sql по дате отправления: