Skip to content

Instantly share code, notes, and snippets.

@zitterbewegung
Created January 17, 2010 15:40
Show Gist options
  • Select an option

  • Save zitterbewegung/279418 to your computer and use it in GitHub Desktop.

Select an option

Save zitterbewegung/279418 to your computer and use it in GitHub Desktop.
=== modified file 'static/xslt/export/gpx.xsl'
--- static/xslt/export/gpx.xsl 2010-01-17 11:11:12 +0000
+++ static/xslt/export/gpx.xsl 2010-01-17 15:19:19 +0000
@@ -1,12 +1,13 @@
<xsl:stylesheet version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/1"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
->
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/sahanapy">
- <gpx creator="" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1">
+ <gpx creator="" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
+ version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1">
<xsl:apply-templates select="resource"/>
+ <xsl:apply-templates select="location"/>
</gpx>
</xsl:template>
<xsl:template match="resource">
@@ -19,4 +20,28 @@
</wpt>
</xsl:if>
</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+<xsl:template match="location">
+<xsl:if test="@name='gis_location'">
+ <wpt>
+ <xsl:attribute name="lat"><xsl:value-of select="data[@field='lat']"/></xsl:attribute>
+ <xsl:attribute name="lon"><xsl:value-of select="data[@field='lon']"/></xsl:attribute>
+ <name><xsl:value-of select="data[@field='name']"/></name>
+ <desc><xsl:value-of select="data[@field='name']"/> <xsl:value-of select="@url"/></desc>
+ </wpt>
+</xsl:if>
+</xsl:template>
+<!--
+ <Placemark>
+ <name><xsl:value-of select="data[@field='name']"/></name>
+ <description><xsl:value-of select="@url"/></description>
+ <Point>
+ <coordinates>
+ <xsl:value-of select="data[@field='lon']"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="data[@field='lat']"/>
+ </coordinates>
+ </Point>
+ </Placemark>
+-->
+</xsl:template>
+</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment