Re: XML validation of whitespace values

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: XML validation of whitespace values
Дата
Msg-id 5370180E.7010301@gmx.net
обсуждение исходный текст
Ответ на XML validation of whitespace values  (Tim Kane <tim.kane@gmail.com>)
Список pgsql-general
On 3/14/14, 11:12 AM, Tim Kane wrote:
> clone=# select xml_is_well_formed(' ');
>  xml_is_well_formed
> --------------------
>  t
> (1 row)
>
>
> clone=# select xpath_exists (‘//test', ' ');
> ERROR:  could not parse XML document
> DETAIL:  line 1: Start tag expected, '<' not found

There are several issues at work here:

- contrib/xml2 has a slightly different notion of what is an OK xml
value than the built-in xml type.

- A string consisting of whitespace is well-formed XML content, but not
a well-formed XML document.  Compare xmlparse(document ' ') vs
xmlparse(content ' ').  contrib/xml2 (apparently) follows the latter
interpretation.

- xpath queries only work properly on XML documents.

It might be better if you wrote your code without using contrib/xml2,
and instead caught any parse exceptions in, say, plpgsql code.



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

Предыдущее
От: Rafał Pietrak
Дата:
Сообщение: Re: Re: Partitioning such that key field of inherited tables no longer retains any selectivity
Следующее
От: David G Johnston
Дата:
Сообщение: Re: XML validation of whitespace values