Thread: problem using a xpath function

problem using a xpath function

From
erithema
Date:
hello everyone
I'm working on PostgreSQL XML Extension.
My system is windows xp professional sp2 and
PostgreSQL 8.3.3 and I am sure installed xml2 module.

I have a 2 colums table:

CREATE TABLE autori ( id_autori SERIAL PRIMARY KEY , testo XML );

I have a problem using a xpath function.
My query is:

SELECT id_autori , xpath ('/Authority/Nome', testo)
  FROM autori
 WHERE  xpath_bool('/Authority[Nome="ABELARDO"]', testo) ;

I get this error:
ERROR : the function xpath_bool(unknown , xml) do not exsist at character 69
HINT: no function matches the given name and argument types. You might need
to add explicit type casts


Any Idea ?
thanks
--
View this message in context: http://www.nabble.com/problem-using-a-xpath-function-tp18853909p18853909.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: problem using a xpath function

From
Peter Eisentraut
Date:
Am Wednesday, 6. August 2008 schrieb erithema:>
> SELECT id_autori , xpath ('/Authority/Nome', testo)
>   FROM autori
>  WHERE  xpath_bool('/Authority[Nome="ABELARDO"]', testo) ;
>
> I get this error:
> ERROR : the function xpath_bool(unknown , xml) do not exsist at character
> 69 HINT: no function matches the given name and argument types. You might
> need to add explicit type casts

The xpath_bool function takes its XML data as type text.  The new xpath()
function uses the XML type.  Those are two different sets of functions.