diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-03-30 07:07:13 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-01 08:06:09 -0700 |
commit | 1aced1302577ded847f48cbbafa6b1a5c8558061 (patch) | |
tree | 86803ceadc61ad847c3d1d4988b9f1f38f8ed79a /xslt/csv2xml.xslt | |
parent | 78904b74b1de6f5c98cb06bcceb56d731fe46e86 (diff) | |
download | subsurface-1aced1302577ded847f48cbbafa6b1a5c8558061.tar.gz |
Do not convert empty temperature
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt/csv2xml.xslt')
-rw-r--r-- | xslt/csv2xml.xslt | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt index baff08f17..fa1cd3afb 100644 --- a/xslt/csv2xml.xslt +++ b/xslt/csv2xml.xslt @@ -287,16 +287,18 @@ <xsl:with-param name="line" select="$line"/> </xsl:call-template> </xsl:variable> - <xsl:attribute name="temp"> - <xsl:choose> - <xsl:when test="$units = 0"> - <xsl:value-of select="translate($temp, ',', '.')"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat(format-number((translate($temp, ',', '.') - 32) * 5 div 9, '0.0'), ' C')"/> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> + <xsl:if test="$temp != ''"> + <xsl:attribute name="temp"> + <xsl:choose> + <xsl:when test="$units = 0"> + <xsl:value-of select="translate($temp, ',', '.')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat(format-number((translate(translate($temp, translate($temp, '0123456789,.', ''), ''), ',', '.') - 32) * 5 div 9, '0.0'), ' C')"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:if> </xsl:if> <xsl:choose> |