Re: PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files
Дата
Msg-id 200808121240.32797.peter_e@gmx.net
обсуждение исходный текст
Ответ на PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files  ("Lawrence Oluyede" <l.oluyede@gmail.com>)
Список pgsql-general
Am Thursday, 7. February 2008 schrieb Lawrence Oluyede:
> PostgreSQL 8.3 instead doesn't allow the insertion of XML with doctype
> in its new native data type returning this error message:
>
> """
> ERROR:  invalid XML content
> DETAIL:  Entity: line 2: parser error : StartTag: invalid element name
> <!DOCTYPE foo>
>  ^

It turns out that this behavior is entirely correct.  It depends on the XML
option.  If you set the XML option to DOCUMENT, you can parse documents
including DOCTYPE declarations.  If you set the XML option to CONTENT, then
what you can parse is defined by the production

XMLDecl? content

which does not allow for a DOCTYPE.

The default XML option is CONTENT, which explains the behavior.

Now, the supercorrect way to parse XML values would be using the XMLPARSE()
function, which requires you to specify the XML option inline.  That way,
everything works.

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

Предыдущее
От: "MuraliPD@GMail"
Дата:
Сообщение: Need help returning record set from a dynamic sql query
Следующее
От: Joao Ferreira gmail
Дата:
Сообщение: Re: big database with very small dump !?