Re: xmlconcat (was 9.0 release notes done) - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: xmlconcat (was 9.0 release notes done)
Date
Msg-id 1269458112.1185.6.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: xmlconcat (was 9.0 release notes done)  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: xmlconcat (was 9.0 release notes done)
List 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/>




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: xmlconcat (was 9.0 release notes done)
Next
From: Markus Wanner
Date:
Subject: Re: dtester-0.1 released