← Back to team overview

maria-discuss team mailing list archive

Connect engine assistance needed with nested first node in XML

 

Hi,

I'm trying to parse GPX files, which are XML with the connect engine.
They look like this:

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="runtastic - makes sports funtastic,
http://www.runtastic.com";>
  <trk>
    <trkseg>
        <trkpt lon="-0.7057708501815800" lat="51.4470825195312003">
                <ele>76.6089172363281</ele>
                <time>2013-08-12T18:17:25.000Z</time>
        </trkpt>
        <trkpt lon="-0.7059442996978760" lat="51.4470443725586009">
                <ele>72.1513061523437</ele>
                <time>2013-08-12T18:17:28.000Z</time>
        </trkpt>
        <trkpt lon="-0.7059520483016970" lat="51.4470558166503977">
                <ele>75.0039749145508</ele>
                <time>2013-08-12T18:17:30.000Z</time>
        </trkpt>
    </trkseg>
  </trk>
</gpx>

Once I have the Connect -engine enabled I do the following:

create table GPXSource (
   lat char(20) field_format='@',
   lon char(20) field_format='@')
   engine=CONNECT table_type=XML
file_name='/home/rasmus/nodegpxmariadb/public/uploads/runtastic_20130812_2157_Running.gpx'
tabname='gpx/trk/trkseg'
   option_list='rownode=trkpt';

It doesn't work, I cannot figure out how to tell the Connect engine
that the data I'm interested is beneath the gpx/trk/trkseg -node
(tabname). If I remove the trk and trkseg -nodes from the data and
just have the gpx -node left and all trkpt -nodes inside it everything
works perfectly. Any help is appriciated.

BR,
Rasmus

--

Rasmus Johansson, VP Engineering
MariaDB | t: +358 50 499 9589 | Skype: ratzpo


Follow ups