get attribute from XML

From: Viktor Bojović <viktor(dot)bojovic(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: get attribute from XML
Date: 2010-10-11 23:03:34
Message-ID: AANLkTinAMcqZdCE0jvhekcH0oBMkiu-Qb4v8KJkQy5ox@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
while parsing this type of XML:
<entry version="21" modified="2009-07-07" dataset="S" created="2009-06-16">
<accession>Q91G55</accession>

i tried this query to get the modified attribute
select xpath('//entry/modified/text()',xml) from xml_sprot limit 10;
but it doesn't work.

So im asking if anyone can help me with that.

Thanx in advance
--
---------------------------------------
Viktor Bojović
---------------------------------------
Wherever I go, Murphy goes with me

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Markus Schatten 2010-10-12 00:22:05 Re: get attribute from XML
Previous Message James Cloos 2010-10-09 07:49:12 Re: counting related rows