Re: select xpath ...

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: select xpath ...
Date: 2011-09-19 14:49:20
Message-ID: 4E775670.9090208@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Having a name space in the doc requires it's usage in the query.

On 09/17/2011 11:48 AM, boris wrote:
> hi all,
> I've inserted xml file :
>
> <?xml version="1.0"?>
> <document xmlns:s1="urn:myorg/s1" xmlns="urn:myorg"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <id num="111-222-333-4444"/>
> <title>zzzzzz</title>
> ......................
>
>
> to a table:
>
> CREATE TABLE "temp".tempxml
> (
> record xml
> )
>
> I can get it using:
> select * from temp.tempxml
>
>
> but, I can't get any values using xpath. ex:
>
>
> select (xpath('/document/title/text()', record ))[1] from temp.tempxml
>
>
> am I doing it right?
>
> thanks.
>
>
>
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message boris 2011-09-19 15:49:03 Re: select xpath ...
Previous Message Tim Landscheidt 2011-09-17 18:34:29 Re: Passing function parameters to regexp_replace