Re: XML Issue with DTDs

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: XML Issue with DTDs
Date: 2013-12-29 23:33:56
Message-ID: 41B1A9EC-029D-4CED-9830-5E7E42CAA960@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Dec26, 2013, at 21:30 , Florian Pflug <fgp(at)phlo(dot)org> wrote:
> On Dec23, 2013, at 18:39 , Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>> On 12/19/13, 6:40 PM, Florian Pflug wrote:
>>> The following example fails for XMLOPTION set to DOCUMENT as well as for XMLOPTION set to CONTENT.
>>>
>>> select xmlconcat(
>>> xmlparse(document '<!DOCTYPE test [<!ELEMENT test EMPTY>]><test/>'),
>>> xmlparse(content '<test/>')
>>> )::text::xml;
>>
>> The SQL standard specifies that DTDs are dropped by xmlconcat. It's
>> just not implemented.
>
> OK, cool, I'll try to figure out how to do that with libxml

Hm, I've read through the (draft) SQL/XML 2003 standard, and it seems that
it mandates more processing of DTDs than we currently do. In particular, it
says that attribute default values and custom entities are to be expanded
by xmlparse(). Without doing that, stripping the DTD can change the meaning
of an XML document, or make it not well-formed (in the case of custom
entity definitions). So I think that we unless we implement that, I we have
to raise an error, not silently strip the DTD.

best regards,
Florian Pflug

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-12-30 00:49:32 Custom collations, collation modifiers (eg case-insensitive)
Previous Message Kevin Grittner 2013-12-29 21:35:14 Re: [BUG FIX] Version number expressed in octal form by mistake