summaryrefslogtreecommitdiffstats
path: root/xslt/divelogs.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-02-21 08:37:45 +0530
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-20 20:19:59 -0800
commitff1c33401bba25ab02efdcd23e52a3c3a14ab1b6 (patch)
treec96c84738420188ae158fb05326339afe2430884 /xslt/divelogs.xslt
parentdcad3af8b63558d9d62cf995de6b4043c3f751fb (diff)
downloadsubsurface-ff1c33401bba25ab02efdcd23e52a3c3a14ab1b6.tar.gz
Divelogs.de import empty value fix
This checks that weight and dive durantion are defined before importing. (Empty value concatenated with unit gives an error on import.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/divelogs.xslt')
-rw-r--r--xslt/divelogs.xslt26
1 files changed, 15 insertions, 11 deletions
diff --git a/xslt/divelogs.xslt b/xslt/divelogs.xslt
index f010c8485..879fd3d32 100644
--- a/xslt/divelogs.xslt
+++ b/xslt/divelogs.xslt
@@ -25,9 +25,11 @@
<xsl:attribute name="time">
<xsl:value-of select="TIME"/>
</xsl:attribute>
- <xsl:attribute name="duration">
- <xsl:value-of select="concat(floor(number(DIVETIMESEC) div 60), ':', format-number(floor(number(DIVETIMESEC) mod 60), '00'), ' min')"/>
- </xsl:attribute>
+ <xsl:if test="DIVETIMESEC != ''">
+ <xsl:attribute name="duration">
+ <xsl:value-of select="concat(floor(number(DIVETIMESEC) div 60), ':', format-number(floor(number(DIVETIMESEC) mod 60), '00'), ' min')"/>
+ </xsl:attribute>
+ </xsl:if>
<depth>
<xsl:if test="MAXDEPTH != ''">
@@ -105,14 +107,16 @@
</xsl:attribute>
</cylinder>
- <weightsystem>
- <xsl:attribute name="description">
- <xsl:value-of select="'unknown'"/>
- </xsl:attribute>
- <xsl:attribute name="weight">
- <xsl:value-of select="concat(WEIGHT, ' kg')"/>
- </xsl:attribute>
- </weightsystem>
+ <xsl:if test="WEIGHT != ''">
+ <weightsystem>
+ <xsl:attribute name="description">
+ <xsl:value-of select="'unknown'"/>
+ </xsl:attribute>
+ <xsl:attribute name="weight">
+ <xsl:value-of select="concat(WEIGHT, ' kg')"/>
+ </xsl:attribute>
+ </weightsystem>
+ </xsl:if>
<notes>
<xsl:value-of select="LOGNOTES"/>