Re: Proposal: XML helper functions - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Proposal: XML helper functions
Date
Msg-id 1262719178.6448.0.camel@vanquo.pezone.net
Whole thread Raw
In response to Proposal: XML helper functions  (Scott Bailey <artacus@comcast.net>)
Responses Re: Proposal: XML helper functions  (Scott Bailey <artacus@comcast.net>)
List pgsql-hackers
On tis, 2010-01-05 at 10:14 -0800, Scott Bailey wrote:
> One of the problem with shredding XML is that it is very kludgy to get a 
> scalar value back from xpath. The xpath function always returns an array 
> of XML. So for example, to extract a numeric value you need to:
> 1) use xpath to get the node
> 2) get the first element of the XML array
> 3) cast that to varchar
> 4) cast that to numeric

There has been talk about adding something like xpath_string,
xpath_number, xpath_boolean for fetching xpath expressions that don't
return nodesets.  I think that would fit your use case.




pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: true serializability and predicate locking
Next
From: Peter Eisentraut
Date:
Subject: Re: libpq naming on Win64