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-24 19:15:12
Message-ID: 1269458112.1185.6.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On ons, 2010-03-24 at 14:51 -0400, Andrew Dunstan wrote:
> Actually, I have come to the conclusion that the biggest problem in
> this
> area is that we accept XML documents with a leading DOCTYPE node at
> all.
> Our docs state:
>
> The xml type can store well-formed "documents", as defined by the
> XML standard, as well as "content" fragments, which are defined by
> the production XMLDecl? content in the XML standard.
>
> A document with a leading DOCTYPE node matches neither of these
> rules,
> and when we strip the XMLDecl from a piece of XML where it's followed
> by
> a DOCTYPE node we turn something that is legal XML into something
> that
> isn't, even by our own (or possibly the standard's) relaxed
> definition.
> A doctypedecl can only follow an XMLDecl, see
> <http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-prolog-dtd>.

Our version of SQL/XML support references SQL:2003 which references XML
1.0, where omitting the XMLDecl is legal. You can't omit the XMLDecl in
XML 1.1, because you need it to communicate the fact that it's version
1.1.

But note that that is correctly supported:

=# select xmlconcat('<?xml version="1.0"?><foo/>', '<?xml
version="1.0"?><bar/>');
xmlconcat
--------------
<foo/><bar/>

and

=# select xmlconcat('<?xml version="1.1"?><foo/>', '<?xml
version="1.1"?><bar/>');
xmlconcat
-----------------------------------
<?xml version="1.1"?><foo/><bar/>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2010-03-24 20:06:16 Re: dtester-0.1 released
Previous Message Andrew Dunstan 2010-03-24 18:51:09 Re: xmlconcat (was 9.0 release notes done)