Re: Postgresql 8.4, XPath and name() function

From: Thom Brown <thombrown(at)gmail(dot)com>
To: ced45 <cedric(dot)duprez(at)ifn(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql 8.4, XPath and name() function
Date: 2010-07-13 08:36:42
Message-ID: AANLkTinpGhcOJ6_W1PbuWknQ0xcK1Ycp9apsSCRM0cfJ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 13 July 2010 09:03, ced45 <cedric(dot)duprez(at)ifn(dot)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(at)postgresql(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ced45 2010-07-13 08:44:00 Re: Postgresql 8.4, XPath and name() function
Previous Message Andras Fabian 2010-07-13 08:05:26 Re: PG_DUMP very slow because of STDOUT ??