From: | caracan <antelo_d(at)hotmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | xml, xpath,postgres 9.1 |
Date: | 2012-01-22 17:40:54 |
Message-ID: | 1327254054743-5164387.post@n5.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hello everybody, sorry for my english.
I need to extract the xml: lat, lon and ele. The xml I have it save on a
table (gpx.object_value). For the first two works for me:
SELECT (xpath ('//lat ', gpx.object_value)) [i] FROM gpx
SELECT (xpath ('//lon ', gpx.object_value)) [i] FROM gpx
My question is how do <ele> ? Probe of everything:
'./trk/trkseg/trkpt/ele/text()'
'//ele'
'//ele/text()'
'//*[//ele]'
Please,help me.
TKANKS
Information:
postgres(postgis),eclipse,jsp
INSERT INTO gpx(object_name, object_value) VALUES ('t1.gpx',
cast(pg_read_file('t1.gpx', 0, 1000000) As xml));
Document xml:
- <gpx xmlns="http://www.topografix.com/GPX/1/1" creator="MapMyTracks"
version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd">
- <trk>
- <trkseg>
- <trkpt lat="12.645648333" lon="-7.884185">
<ele>20.2</ele>
<time>2007-12-30T08:27:03Z</time>
</trkpt>
- <trkpt lat .......
--
View this message in context: http://postgresql.1045698.n5.nabble.com/xml-xpath-postgres-9-1-tp5164387p5164387.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2012-01-22 19:18:48 | Re: Database takes up MUCH more disk space than it should |
Previous Message | Tom Lane | 2012-01-22 17:06:20 | Re: Database takes up MUCH more disk space than it should |