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>
This commit is contained in:
Miika Turkia 2018-02-14 21:34:07 +02:00 committed by mturkia
parent 38ac965989
commit 5b422332ac

View file

@ -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:with-param name="units" select="$units"/>
</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>
@ -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:with-param name="units" select="$units"/>
</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>