Re: review: xml_is_well_formed

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: review: xml_is_well_formed
Дата
Msg-id 6299.1281289520@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: review: xml_is_well_formed  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: review: xml_is_well_formed  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On lör, 2010-07-31 at 13:40 -0400, Robert Haas wrote:
>> I think the point of this function is to determine whether a cast to
>> xml will throw an error.  The behavior should probably match exactly
>> whatever test would be applied there.

> Maybe there should be

> xml_is_well_formed()
> xml_is_well_formed_document()
> xml_is_well_formed_content()

> I agree that consistency with SQL/XML is desirable, but for someone
> coming from the outside, the unqualified claim that 'foo' is well-formed
> XML might sound suspicious.

I think I agree with the later discussion that xml_is_well_formed()
should tell you whether a cast to xml would succeed (and hence it has to
pay attention to XMLOPTION).  However, it seems to also make sense to
provide the other two functions suggested here, both to satify people
who know XML and to offer tests that will tell you whether
XMLPARSE ( { DOCUMENT | CONTENT } value ) will succeed.

Merging the three cases into one function doesn't seem like a win
for either compatibility or usability.
        regards, tom lane


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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Initial review of xslt with no limits patch
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: review: psql: edit function, show function commands patch