Re: Postgresql 8.4, XPath and name() function - Mailing list pgsql-general

From Thom Brown
Subject Re: Postgresql 8.4, XPath and name() function
Date
Msg-id AANLkTinpGhcOJ6_W1PbuWknQ0xcK1Ycp9apsSCRM0cfJ@mail.gmail.com
Whole thread Raw
In response to Postgresql 8.4, XPath and name() function  (ced45 <cedric.duprez@ifn.fr>)
Responses Re: Postgresql 8.4, XPath and name() function  (ced45 <cedric.duprez@ifn.fr>)
List pgsql-general
On 13 July 2010 09:03, ced45 <cedric.duprez@ifn.fr> wrote:
>
> Hi List,
>
> I have trouble using XPath name() function in a XML field.
> For example, when I execute the following query :
>
> SELECT XPATH('name(/*)', XMLPARSE(DOCUMENT '<unit>value</unit>'))
>
> I would like to get "unit", but I just get an empty array ({}).
> How can I get "unit" ?
>
eneral@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

Have you tried:

SELECT XPATH('fn:name(/*)', XMLPARSE(DOCUMENT '<unit>value</unit>'));

Thom

pgsql-general by date:

Previous
From: Andras Fabian
Date:
Subject: Re: PG_DUMP very slow because of STDOUT ??
Next
From: ced45
Date:
Subject: Re: Postgresql 8.4, XPath and name() function