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.

      Bob McMahan

      -- Start XSL File --
      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0"
      <xsl:template match="gpx">
      <xsl:apply-templates select="wpt"/>


      <xsl:template match="wpt">
      <h1>Name: <xsl:value-of select="name"/></h1>
      -- 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
      <link href="http://www.garmin.com">
      <text>Garmin International</text>
      <bounds minlat="29.76145810" minlon="-95.64355870"
      maxlat="29.78109730" maxlon="-95.60557110"/>
      <time xmlns="http://www.topografix.com/GPX/gpx_modified/0/1">2007-06-
      lat="29.76968300" lon="-95.64631690">
      <wpt lat="29.76145810" lon="-95.60557110">
      <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>
      <label xmlns="http://www.topografix.com/GPX/gpx_overlay/0/3">
      <label_text>Dairy Ashford Parking</label_text>
      <wpt lat="29.77143440" lon="-95.62040630">
      <name>Eldridge Bathroom</name>
      <cmt>27-MAY-07 11:35:23AM</cmt>
      <desc>27-MAY-07 11:35:23AM</desc>
      <label xmlns="http://www.topografix.com/GPX/gpx_overlay/0/3">
      <label_text>Eldridge Bathroom</label_text>
      <wpt lat="29.76999440" lon="-95.64355870">
      <name>Hwy6 Parking</name>
      <cmt>27-MAY-07 10:48:23AM</cmt>
      <desc>27-MAY-07 10:48:23AM</desc>
      <sym>Parking Area</sym>
      <label xmlns="http://www.topografix.com/GPX/gpx_overlay/0/3">
      <label_text>Hwy6 Parking</label_text>
      -- End GPX file --
    Your message has been successfully submitted and would be delivered to recipients shortly.