Re: xml
От | Pavel Stehule |
---|---|
Тема | Re: xml |
Дата | |
Msg-id | CAFj8pRDPK7Hf3kbm1NqQzfn4XhE+jcWR7eqd1Vy5DfBZhyoetw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: xml (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-general |
2015-03-23 15:09 GMT+01:00 Tom Lane <tgl@sss.pgh.pa.us>:
Pavel Stehule <pavel.stehule@gmail.com> writes:
> result of xmlagg is not valid xml.
Really? Either that's a bug, or it's declared wrong.
I was not accurate. "<tag /><tag />" is not valid xml document - and xpath function doens't like it.
postgres=# select xpath('//tag/@x','<tag x="x"/><tag />'::xml);
ERROR: could not parse XML document
DETAIL: line 1: Extra content at the end of the document
<tag x="x"/><tag />
^
CONTEXT: SQL function "xpath" statement 1
postgres=# select xpath('//tag/@x','<x><tag x="x"/><tag /></x>'::xml);
xpath
-------
{x}
(1 row)
postgres=# select '<tag x="x"/><tag />'::xml;
xml
---------------------
<tag x="x"/><tag />
(1 row)
postgres=# select xpath('//tag/@x','<tag x="x"/><tag />'::xml);
ERROR: could not parse XML document
DETAIL: line 1: Extra content at the end of the document
<tag x="x"/><tag />
^
CONTEXT: SQL function "xpath" statement 1
postgres=# select xpath('//tag/@x','<x><tag x="x"/><tag /></x>'::xml);
xpath
-------
{x}
(1 row)
postgres=# select '<tag x="x"/><tag />'::xml;
xml
---------------------
<tag x="x"/><tag />
(1 row)
Regards
Pavel
regards, tom lane
В списке pgsql-general по дате отправления: