Loading ...
Sorry, an error occurred while loading the content.
 

Learning XSL with GPX files

Expand Messages
  • Robert S. McMahan
    I am trying to learn how to create an XSL file for use with GPX files, and am really having problems. If I use the XSL file against the file Untitled.gpx that
    Message 1 of 1 , Jun 5, 2007
      I am trying to learn how to create an XSL file for use with GPX
      files, and am really having problems. If I use the XSL file against
      the file Untitled.gpx that is in the XSL example in the files area,
      everything works as expected. I get a list of the waypoints in the
      gpx file. If I try against one that I generated from inside of
      ExpertGPS, it gives me all of the data in the GPX file with the tags
      removed. I have tried the XSL file "gpsxml Quick View.xsl" from the
      files area, and it does the same thing. Everything works great with
      the example file that comes with it, but if I point it to the GPX
      file created with either ExpertGPS, or Mapsource, I get all of the
      data in the GPX file minus the tags. I'm sure I'm just missing
      something, but after a week of banging on it, I just don't know what
      else to try.

      Thanks,
      Bob McMahan


      -- Start XSL File --
      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="gpx">
      <html>
      <body>
      <xsl:apply-templates select="wpt"/>

      </body>
      </html>
      </xsl:template>

      <xsl:template match="wpt">
      <h1>Name: <xsl:value-of select="name"/></h1>
      </xsl:template>
      </xsl:stylesheet>
      -- End XSL File --

      -- Start GPX File --
      <?xml version="1.0" encoding="UTF-8"?>
      <gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1"
      creator="ExpertGPS 2.4.2" 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.topografix.com/GPX/gpx_overlay/0/3
      http://www.topografix.com/GPX/gpx_overlay/0/3/gpx_overlay.xsd
      http://www.topografix.com/GPX/gpx_modified/0/1
      http://www.topografix.com/GPX/gpx_modified/0/1/gpx_modified.xsd
      http://www.topografix.com/GPX/Private/TopoGrafix/0/3
      http://www.topografix.com/GPX/Private/TopoGrafix/0/3/topografix.xsd">
      <metadata>
      <link href="http://www.garmin.com">
      <text>Garmin International</text>
      </link>
      <bounds minlat="29.76145810" minlon="-95.64355870"
      maxlat="29.78109730" maxlon="-95.60557110"/>
      <extensions>
      <time xmlns="http://www.topografix.com/GPX/gpx_modified/0/1">2007-06-
      05T17:33:24.672Z</time>
      <active_point
      xmlns="http://www.topografix.com/GPX/Private/TopoGrafix/0/3"
      lat="29.76968300" lon="-95.64631690">
      </active_point>
      </extensions>
      </metadata>
      <wpt lat="29.76145810" lon="-95.60557110">
      <ele>17.37</ele>
      <time>2007-05-28T03:53:09Z</time>
      <name>Dairy Ashford Parking</name>
      <cmt>27-MAY-07 12:00:15PM</cmt>
      <desc>27-MAY-07 12:00:15PM</desc>
      <sym>Parking Area</sym>
      <extensions>
      <label xmlns="http://www.topografix.com/GPX/gpx_overlay/0/3">
      <label_text>Dairy Ashford Parking</label_text>
      </label>
      </extensions>
      </wpt>
      <wpt lat="29.77143440" lon="-95.62040630">
      <ele>21.64</ele>
      <time>2007-05-28T03:53:09Z</time>
      <name>Eldridge Bathroom</name>
      <cmt>27-MAY-07 11:35:23AM</cmt>
      <desc>27-MAY-07 11:35:23AM</desc>
      <sym>Restroom</sym>
      <extensions>
      <label xmlns="http://www.topografix.com/GPX/gpx_overlay/0/3">
      <label_text>Eldridge Bathroom</label_text>
      </label>
      </extensions>
      </wpt>
      <wpt lat="29.76999440" lon="-95.64355870">
      <ele>16.76</ele>
      <time>2007-05-28T03:53:09Z</time>
      <name>Hwy6 Parking</name>
      <cmt>27-MAY-07 10:48:23AM</cmt>
      <desc>27-MAY-07 10:48:23AM</desc>
      <sym>Parking Area</sym>
      <extensions>
      <label xmlns="http://www.topografix.com/GPX/gpx_overlay/0/3">
      <label_text>Hwy6 Parking</label_text>
      </label>
      </extensions>
      </wpt>
      </gpx>
      -- End GPX file --
    Your message has been successfully submitted and would be delivered to recipients shortly.