summaryrefslogtreecommitdiffstats
path: root/xslt/MacDive.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-03-07 21:57:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-07 11:58:57 -0800
commit9f6b8ca89a0d8828f2b60b01326f3bd9f021112c (patch)
treec0d9bbb4ea83e66789441978f4cbc5fb9e13c507 /xslt/MacDive.xslt
parenteee29f2187632ff8a34abb8ce65e37314e60278e (diff)
downloadsubsurface-9f6b8ca89a0d8828f2b60b01326f3bd9f021112c.tar.gz
Translate comma to colon on XML import
Translate decimal commas on XML import to decimal points. (As detected from available sample files using Linus' debug printing.) Also check for empty values on MacDive temperature import. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/MacDive.xslt')
-rw-r--r--xslt/MacDive.xslt10
1 files changed, 7 insertions, 3 deletions
diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index e9ad9a801..c719e6931 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -297,7 +297,7 @@
<weightsystem>
<xsl:attribute name="weight">
<xsl:call-template name="weightConvert">
- <xsl:with-param name="weight" select="weight"/>
+ <xsl:with-param name="weight" select="translate(weight, ',', '.')"/>
<xsl:with-param name="units" select="$units"/>
</xsl:call-template>
</xsl:attribute>
@@ -435,10 +435,14 @@
<xsl:choose>
<xsl:when test="$units = 'Imperial'">
- <xsl:value-of select="concat(format-number(($temp - 32) * 5 div 9, '0.0'), ' C')"/>
+ <xsl:if test="$temp != ''">
+ <xsl:value-of select="concat(format-number(($temp - 32) * 5 div 9, '0.0'), ' C')"/>
+ </xsl:if>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="concat($temp, ' C')"/>
+ <xsl:if test="$temp != ''">
+ <xsl:value-of select="concat($temp, ' C')"/>
+ </xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>