summaryrefslogtreecommitdiffstats
path: root/xslt/divelogs-export.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-08-16 10:00:14 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-16 06:57:55 -0600
commitbb39a8730bae923e01f8cbcf1384e5dc54c49b2d (patch)
treedaee06a796330eaa5d50f3b6156e7a924976ff3d /xslt/divelogs-export.xslt
parent64c9fff850e794812c22e7fdf8e2d15938138a48 (diff)
downloadsubsurface-bb39a8730bae923e01f8cbcf1384e5dc54c49b2d.tar.gz
Hack double tank support for export to divelogs
If the cylinder description starts with D%d we test if the size in description matches the cylinder size. If the cylinder size is double compared to size in description, we mark the dive as double tank dive to divelogs.de. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/divelogs-export.xslt')
-rw-r--r--xslt/divelogs-export.xslt16
1 files changed, 15 insertions, 1 deletions
diff --git a/xslt/divelogs-export.xslt b/xslt/divelogs-export.xslt
index 3de8c60b9..ec39ba243 100644
--- a/xslt/divelogs-export.xslt
+++ b/xslt/divelogs-export.xslt
@@ -69,8 +69,22 @@
<CYLINDERDESCRIPTION>
<xsl:value-of select="cylinder[position() = $cylinder]/@description"/>
</CYLINDERDESCRIPTION>
+
+ <xsl:variable name="double">
+ <xsl:choose>
+ <xsl:when test="substring(cylinder[position() = $cylinder]/@description, 1, 1) = 'D' and substring-before(substring(cylinder[position() = $cylinder]/@description, 2), ' ') * 2 = substring-before(cylinder[position() = $cylinder]/@size, ' ')">
+ <xsl:value-of select="'2'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'1'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <DBLTANK>
+ <xsl:value-of select="$double - 1"/>
+ </DBLTANK>
<CYLINDERSIZE>
- <xsl:value-of select="substring-before(cylinder[position() = $cylinder]/@size, ' ')"/>
+ <xsl:value-of select="substring-before(cylinder[position() = $cylinder]/@size, ' ') div $double"/>
</CYLINDERSIZE>
<CYLINDERSTARTPRESSURE>
<xsl:choose>