Created
September 27, 2015 17:06
-
-
Save rmtsrc/baad49fcea3b0659824c to your computer and use it in GitHub Desktop.
Converts a Ride with GPS GPX Route cuesheet into a format that can be used within a Garmin TCX file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gpx="http://www.topografix.com/GPX/1/1"> | |
<xsl:template match="/"> | |
<TrainingCenterDatabase xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd"> | |
<Courses> | |
<Course> | |
<xsl:for-each select="//gpx:rtept"> | |
<CoursePoint> | |
<Name><xsl:value-of select="gpx:name"/></Name> | |
<Time>2000-01-01T00:00:00Z</Time> | |
<Position> | |
<LatitudeDegrees><xsl:value-of select="@lat"/></LatitudeDegrees> | |
<LongitudeDegrees><xsl:value-of select="@lon"/></LongitudeDegrees> | |
</Position> | |
<AltitudeMeters>0</AltitudeMeters> | |
<PointType><xsl:value-of select="gpx:name"/></PointType> | |
<Notes><xsl:value-of select="gpx:cmt"/></Notes> | |
</CoursePoint> | |
</xsl:for-each> | |
</Course> | |
</Courses> | |
</TrainingCenterDatabase> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment