Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

Поиск
Список
Период
Сортировка
От Mike Berrow
Тема Issue: Deprecation of the XML2 module 'xml_is_well_formed' function
Дата
Msg-id AANLkTim8ije1V2-yiK794kGjc-9ZdgW_0wLweYbg5ffS@mail.gmail.com
обсуждение исходный текст
Ответы Re: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
We need to make extensive use of the 'xml_is_well_formed' function provided by the XML2 module.

Yet the documentation says that the xml2 module will be deprecated since "XML syntax checking and XPath queries"
is covered by the XML-related functionality based on the SQL/XML standard in the core server from PostgreSQL 8.3 onwards.

However, the core function XMLPARSE does not provide equivalent functionality since when it detects an invalid XML document,
it throws an error rather than returning a truth value (which is what we need and currently have with the 'xml_is_well_formed' function).

For example:

select xml_is_well_formed('<br></br2>');
 xml_is_well_formed
--------------------
 f
(1 row)

select XMLPARSE( DOCUMENT '<br></br2>' );
ERROR:  invalid XML document
DETAIL:  Entity: line 1: parser error : expected '>'
<br></br2>
        ^
Entity: line 1: parser error : Extra content at the end of the document
<br></br2>
        ^

Is there some way to use the new, core XML functionality to simply return a truth value
in the way that we need?.

Thanks,
-- Mike Berrow

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: testing plpython3u on 9.0beta2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: testing plpython3u on 9.0beta2