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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Lawrence Oluyede <l(dot)oluyede(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files
Date: 2008-03-05 18:29:22
Message-ID: 200803051829.m25ITM728602@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Is this a bug that needs to be fixed?

---------------------------------------------------------------------------

Lawrence Oluyede wrote:
> 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?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ralph Smith 2008-03-05 18:37:00 Fwd: Requiring a password
Previous Message Ralph Smith 2008-03-05 18:28:19 Requiring a password

Browse pgsql-hackers by date

  From Date Subject
Next Message Lawrence Oluyede 2008-03-05 18:37:37 Re: [GENERAL] PostgreSQL 8.3 XML parser seems not to recognize the DOCTYPE element in XML files
Previous Message Gurjeet Singh 2008-03-05 18:07:46 Re: Patch to update libpqxx's homepage in README