Re: xmlconcat (was 9.0 release notes done)

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: xmlconcat (was 9.0 release notes done)
Date: 2010-03-22 21:31:31
Message-ID: 1269293491.14588.13.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On sön, 2010-03-21 at 13:07 -0400, Andrew Dunstan wrote:
> Yeah, maybe. According to
> <http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html> the only
> legal child of an XML Document node that is not also a legal child of a
> DocumentFragment node is a DocumentType node. So we could probably just
> look for one of those in each argument node and strip it out. That
> should be fairly lightweight in the common case where it's not present -
> we'd just be searching for a fixed string. Removing it if found would be
> more complex. We'd have to parse the node to remove it, since a legal
> DocumentType node string could appear legally inside a CDATA node.

According to the SQL/XML standard, the document type declaration should
apparently be stripped when doing a concatenation. (This makes sense
because the result of a concatenation can never be valid according to a
DTD.)

But if we are not comfortable about being able to do that safely, I
would be OK with just raising an error if a concatenation is attempted
where one value contains a DTD. The impact in practice should be low.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2010-03-22 21:35:00 Re: An idle thought
Previous Message Peter Eisentraut 2010-03-22 21:23:43 Re: proposal: more practical view on function's source code