Re: Patch Review: Bugfix for XPATH() if text or attribute nodes are selected - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Patch Review: Bugfix for XPATH() if text or attribute nodes are selected
Date
Msg-id 1310645715.16381.2.camel@fsopti579.F-Secure.com
Whole thread Raw
In response to Re: Patch Review: Bugfix for XPATH() if text or attribute nodes are selected  (Nicolas Barbier <nicolas.barbier@gmail.com>)
List pgsql-hackers
On ons, 2011-07-13 at 11:58 +0200, Nicolas Barbier wrote:
> 2011/6/29, Florian Pflug <fgp@phlo.org>:
> 
> > Secondly, there is little point in having an type XML if we
> > don't actually ensure that values of that type can only contain
> > well-formed XML.
> 
> +1. The fact that XPATH() must return a type that cannot depend on the
> given expression (even if it is a constant string) may be unfortunate,
> but returning XML-that-is-not-quite-XML sounds way worse to me.

The example given was
   XPATH('/*/text()', '<root><</root>')

This XPath expression returns a node set, and XML is a serialization
format of a node, so returning xml[] in this particular case seems
entirely reasonable to me.



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Understanding GIN posting trees
Next
From: Peter Eisentraut
Date:
Subject: Re: Patch Review: Bugfix for XPATH() if text or attribute nodes are selected