0

I'm trying to load a Garmin gpx track file (xlm) into a database. So I created an xsl to convert data to a table (I'm good in SQL but I'm not a developer - so this is a completly unfamiliar ground for me ...). No success at all. Neither InternetExplorer nor Firefox or XML Notepad created a table. But with example data everything worked. So I had a closer look at the gpx-file and I tried to find out what's blocking me.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v2" xmlns:trp="http://www.garmin.com/xmlschemas/TripExtensions/v1" creator="BMW Motorrad Navigator VII" 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 http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v2 http://www.garmin.com/xmlschemas/TrackPointExtensionv2.xsd http://www.garmin.com/xmlschemas/TripExtensions/v1 http://www.garmin.com/xmlschemas/TripExtensionsv1.xsd">
  <metadata>
    <link href="http://www.garmin.com">
      <text>Garmin International</text>
    </link>
    <time>2021-12-31T10:05:14Z</time>
  </metadata>
  <trk>
    <name>Track vom: 2021-12-24 12:41</name>
    <trkseg>
      <trkpt lat="45.123456" lon="9.654321">
        <ele>234.54</ele>
        <time>2021-12-24T10:41:21Z</time>
        <extensions>
          <gpxtpx:TrackPointExtension>
            <gpxtpx:speed>3.37</gpxtpx:speed>
            <gpxtpx:course>99.71</gpxtpx:course>
          </gpxtpx:TrackPointExtension>
        </extensions>
      </trkpt>
...

After I deleted the default namespace "xmlns=http://www.topografix.com/GPX/1/1" I was able to process the data. So this xmlns without prefix is preventing me from looking up attributes and elements in the xlm tree.

Is there a way to handle this default namespace in xsl? Or do I have to preprocess all track-files and delete the xmlns reference before applying the xsl?

Thx

w.

wolfgang
  • 1
  • 1

0 Answers0