summaryrefslogtreecommitdiffstats
path: root/xslt/udcf.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-02-13 22:40:01 +0200
committerGravatar mturkia <miika.turkia@gmail.com>2018-02-15 17:54:05 +0200
commit1e45637575d316e86360a6bde7729f396bd2175b (patch)
treec8a9e5acc81694c6333549727eaaab80a8529cf2 /xslt/udcf.xslt
parent405e5050a1585ee062f3f96771257af00bf65173 (diff)
downloadsubsurface-1e45637575d316e86360a6bde7729f396bd2175b.tar.gz
UDCF import: support for imperial depths
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt/udcf.xslt')
-rw-r--r--xslt/udcf.xslt39
1 files changed, 37 insertions, 2 deletions
diff --git a/xslt/udcf.xslt b/xslt/udcf.xslt
index 623273b8d..f95e2036b 100644
--- a/xslt/udcf.xslt
+++ b/xslt/udcf.xslt
@@ -1,6 +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:include href="commonTemplates.xsl"/>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
@@ -125,7 +126,24 @@
format-number(floor($timeSec mod $timeconvert), '00'), ' min')"/>
</xsl:attribute>
<xsl:attribute name="depth">
- <xsl:value-of select="concat(., ' m')"/>
+ <xsl:choose>
+ <xsl:when test="//units|//UNITS = 'imperial'">
+ <xsl:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="'Imperial'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="'Metric'"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:attribute>
</sample>
</xsl:for-each>
@@ -161,7 +179,24 @@
format-number(floor($timeSec mod 60), '00'), ' min')"/>
</xsl:attribute>
<xsl:attribute name="depth">
- <xsl:value-of select="concat(., ' m')"/>
+ <xsl:choose>
+ <xsl:when test="//units|//UNITS = 'imperial'">
+ <xsl:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="'Imperial'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="'Metric'"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:attribute>
</sample>
</xsl:for-each>