Only import weight if available

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
Miika Turkia 2017-03-29 20:03:06 +03:00 committed by Dirk Hohndel
parent 919cfc9dee
commit 62c7abc2a8

View file

@ -421,14 +421,16 @@
</xsl:if>
<xsl:if test="$weightField >= 0">
<weightsystem description="imported">
<xsl:attribute name="weight">
<xsl:variable name="weight">
<xsl:call-template name="getFieldByIndex">
<xsl:with-param name="index" select="$weightField"/>
<xsl:with-param name="line" select="$line"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="translate($weight, translate($weight, '1234567890,.', ''), '') > 0">
<weightsystem description="imported">
<xsl:attribute name="weight">
<xsl:choose>
<xsl:when test="$units = 0">
<xsl:value-of select="translate($weight, translate($weight, '1234567890,.', ''), '')"/>
@ -440,6 +442,7 @@
</xsl:attribute>
</weightsystem>
</xsl:if>
</xsl:if>
</dive>
</xsl:if>