Re: Postgresql 8.4, XPath and name() function

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql 8.4, XPath and name() function
Date: 2010-07-13 16:09:27
Message-ID: m3zkxvgy88.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ced45 <cedric(dot)duprez(at)ifn(dot)fr> wrote:

> 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" ?

AFAIK, this is not related to PostgreSQL, but inherent to
XPath in that it returns elements from the document that
fulfill the XPath expression *unchanged*.

So you will probably have to tackle your problem from an-
other angle.

Tim

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Duncavage, Daniel P. (JSC-OD211) 2010-07-13 16:14:51 NASA needs Postgres - Nagios help
Previous Message Joshua D. Drake 2010-07-13 15:45:27 Re: Atul.Goel@globaldatapoint.com