aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-02-14 21:33:46 +0200
committerGravatar mturkia <miika.turkia@gmail.com>2018-02-15 17:54:05 +0200
commit38ac965989093236da2bdeb4afbdb42470159c30 (patch)
tree8e48d33a8ce157dac57830ddd074f40ea60a89e9
parent3cf9989d65767797b2e6f45494be73610cd1036a (diff)
downloadsubsurface-38ac965989093236da2bdeb4afbdb42470159c30.tar.gz
UDCF import: store units in a variable
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
-rw-r--r--xslt/udcf.xslt10
1 files changed, 10 insertions, 0 deletions
diff --git a/xslt/udcf.xslt b/xslt/udcf.xslt
index f95e2036b..359e606b5 100644
--- a/xslt/udcf.xslt
+++ b/xslt/udcf.xslt
@@ -31,6 +31,16 @@
</xsl:template>
<xsl:template match="DIVE|dive">
+ <xsl:variable name="units">
+ <xsl:choose>
+ <xsl:when test="//units|//UNITS = 'imperial'">
+ <xsl:value-of select="'Imperial'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'Metric'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<dive>
<xsl:attribute name="date">
<xsl:for-each select="DATE/YEAR|DATE/MONTH|DATE/DAY|date/year|date/month|date/day">