summaryrefslogtreecommitdiffstats
path: root/xslt/udcf.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-02-14 21:34:07 +0200
committerGravatar mturkia <miika.turkia@gmail.com>2018-02-15 17:54:05 +0200
commit5b422332ac7b414ed693705da172c2e455e15047 (patch)
treeb769be182f326fe883504d3203dcbead52e942b7 /xslt/udcf.xslt
parent38ac965989093236da2bdeb4afbdb42470159c30 (diff)
downloadsubsurface-5b422332ac7b414ed693705da172c2e455e15047.tar.gz
UDCF import: use unit variable
Simplify depth conversion from by using the unit variable and allowing dephtConvert template to do the work. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt/udcf.xslt')
-rw-r--r--xslt/udcf.xslt48
1 files changed, 12 insertions, 36 deletions
diff --git a/xslt/udcf.xslt b/xslt/udcf.xslt
index 359e606b5..ce536677a 100644
--- a/xslt/udcf.xslt
+++ b/xslt/udcf.xslt
@@ -136,24 +136,12 @@
format-number(floor($timeSec mod $timeconvert), '00'), ' min')"/>
</xsl:attribute>
<xsl:attribute name="depth">
- <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:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="$units"/>
+ </xsl:call-template>
</xsl:attribute>
</sample>
</xsl:for-each>
@@ -189,24 +177,12 @@
format-number(floor($timeSec mod 60), '00'), ' min')"/>
</xsl:attribute>
<xsl:attribute name="depth">
- <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:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="."/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="$units"/>
+ </xsl:call-template>
</xsl:attribute>
</sample>
</xsl:for-each>