Re: [HACKERS] Proposal: XML helper functions

2012-02-19 Thread Larry
But by using the above code: how do we deal with multiple matching values? For example: java c++ In this case, perhaps I would want something like ---+- my_question | java my_question | c++ -- View this message in context: http://postgresql.1045698.n5.nabble.com/

Re: [HACKERS] Proposal: XML helper functions

2010-01-05 Thread Peter Eisentraut
On tis, 2010-01-05 at 11:50 -0800, Scott Bailey wrote: > > 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. > > The first two sound very much like wh

Re: [HACKERS] Proposal: XML helper functions

2010-01-05 Thread Scott Bailey
Peter Eisentraut wrote: 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) us

Re: [HACKERS] Proposal: XML helper functions

2010-01-05 Thread Scott Bailey
Pavel Stehule wrote: 2010/1/5 Scott Bailey : 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 f

Re: [HACKERS] Proposal: XML helper functions

2010-01-05 Thread Peter Eisentraut
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

Re: [HACKERS] Proposal: XML helper functions

2010-01-05 Thread Scott Bailey
Merlin Moncure wrote: On Tue, Jan 5, 2010 at 1:14 PM, 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 xpat

Re: [HACKERS] Proposal: XML helper functions

2010-01-05 Thread Pavel Stehule
2010/1/5 Scott Bailey : > 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 o

Re: [HACKERS] Proposal: XML helper functions

2010-01-05 Thread Merlin Moncure
On Tue, Jan 5, 2010 at 1:14 PM, 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

[HACKERS] Proposal: XML helper functions

2010-01-05 Thread Scott Bailey
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