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>
This commit is contained in:
Miika Turkia 2013-02-21 08:37:45 +05:30 committed by Dirk Hohndel
parent dcad3af8b6
commit ff1c33401b

View file

@ -25,9 +25,11 @@
<xsl:attribute name="time"> <xsl:attribute name="time">
<xsl:value-of select="TIME"/> <xsl:value-of select="TIME"/>
</xsl:attribute> </xsl:attribute>
<xsl:if test="DIVETIMESEC != ''">
<xsl:attribute name="duration"> <xsl:attribute name="duration">
<xsl:value-of select="concat(floor(number(DIVETIMESEC) div 60), ':', format-number(floor(number(DIVETIMESEC) mod 60), '00'), ' min')"/> <xsl:value-of select="concat(floor(number(DIVETIMESEC) div 60), ':', format-number(floor(number(DIVETIMESEC) mod 60), '00'), ' min')"/>
</xsl:attribute> </xsl:attribute>
</xsl:if>
<depth> <depth>
<xsl:if test="MAXDEPTH != ''"> <xsl:if test="MAXDEPTH != ''">
@ -105,6 +107,7 @@
</xsl:attribute> </xsl:attribute>
</cylinder> </cylinder>
<xsl:if test="WEIGHT != ''">
<weightsystem> <weightsystem>
<xsl:attribute name="description"> <xsl:attribute name="description">
<xsl:value-of select="'unknown'"/> <xsl:value-of select="'unknown'"/>
@ -113,6 +116,7 @@
<xsl:value-of select="concat(WEIGHT, ' kg')"/> <xsl:value-of select="concat(WEIGHT, ' kg')"/>
</xsl:attribute> </xsl:attribute>
</weightsystem> </weightsystem>
</xsl:if>
<notes> <notes>
<xsl:value-of select="LOGNOTES"/> <xsl:value-of select="LOGNOTES"/>