PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files - Mailing list pgsql-general

From Lawrence Oluyede
Subject PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files
Date
Msg-id 9eebf5740802070148s5bd366a2k278496ca52429bac@mail.gmail.com
Whole thread Raw
Responses Re: PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files  (Bruce Momjian <bruce@momjian.us>)
Re: PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
As specified in the W3C Recommendation for XML the DOCTYPE element is
perfectly valid in a document.
I have a bunch of XML files generated by the boost library which
contains a doctype like this:

<!DOCTYPE boost_serialization>

which lies within the bound of the recommendation
(http://www.w3.org/TR/xml/#sec-prolog-dtd):

"Note that it is possible to construct a well-formed document
containing a doctypedecl that neither points to an external subset nor
contains an internal subset."

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>
 ^

********** Error **********

ERROR: invalid XML content
SQL state: 2200N
Detail: Entity: line 2: parser error : StartTag: invalid element name
<!DOCTYPE foo>
"""

This kind of behavior surprises me because pgsql has been compiled
with the following flags on the development machine:
 ./configure --with-python --with-openssl --with-pam --with-libxml
--with-libxslt --enable-thread-safety --enable-debug

During the configuration stage it creates a Makefile binding the
system version of the libxml2 library which is 2.6.30, the same
library I use through Python (which parses correctly the XML file with
the doctype).

Any hints?

pgsql-general by date:

Previous
From: Hervé Piedvache
Date:
Subject: Re: Kernel kills postgres process - help need
Next
From: Jean-Samuel Reynaud
Date:
Subject: Migration of /data from 32bit to 8.2 64bit