aboutsummaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-01-02 07:44:43 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-01 21:51:42 -0800
commit52f438bcd07754b2c4aae7d20359de9ac2092705 (patch)
tree5e415bc5873db0d3c961637784d42856fd17c3ca /xslt
parentbc16f06536ba0bfbe58660d24243c360e4155f12 (diff)
downloadsubsurface-52f438bcd07754b2c4aae7d20359de9ac2092705.tar.gz
Treat headings properly when importing Suunto logs
This patch will convert a heading bookmark to Subsurface format. Suunto's bookmark uses "Heading: <degrees>°" format and was previously set as the full event name. Now the resulting event will look like: <event name="heading" value="333" time="0:58 min"/> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r--xslt/SuuntoSDM.xslt15
1 files changed, 14 insertions, 1 deletions
diff --git a/xslt/SuuntoSDM.xslt b/xslt/SuuntoSDM.xslt
index 08da67908..14d088c97 100644
--- a/xslt/SuuntoSDM.xslt
+++ b/xslt/SuuntoSDM.xslt
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:strip-space elements="*"/>
- <xsl:output method="xml" indent="yes"/>
+ <xsl:output method="xml" indent="yes" encoding="ASCII"/>
<xsl:template match="/">
<dives>
@@ -200,6 +200,19 @@
</xsl:attribute>
</sample>
</xsl:when>
+ <xsl:when test="substring-before(BOOKMARK, ':') = 'Heading'">
+ <event name="heading">
+ <xsl:attribute name="value">
+ <xsl:value-of select="substring-before(substring-after(BOOKMARK, ': '), '°')"/>
+ </xsl:attribute>
+ <xsl:attribute name="time">
+ <xsl:call-template name="timeConvert">
+ <xsl:with-param name="timeSec" select="SAMPLETIME"/>
+ <xsl:with-param name="units" select="'si'"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </event>
+ </xsl:when>
<xsl:otherwise>
<xsl:if test="BOOKMARK != 'Surface'">
<event name="{BOOKMARK}">