diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2014-11-24 19:23:15 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-24 09:42:19 -0800 |
commit | 61ad81cf7a9fe934b317b046311145bc8b30ca2d (patch) | |
tree | 6b85e1d488b3aecc873964a8a2cc6f4c10d82507 /xslt/manualcsv2xml.xslt | |
parent | f32e6a853e0230c5862cdd15112aef2232f90b2d (diff) | |
download | subsurface-61ad81cf7a9fe934b317b046311145bc8b30ca2d.tar.gz |
Default dive number on manual CSV import
If manual CSV import does not have any dive number, give a default one
so that the dives get import and not silently ignored.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/manualcsv2xml.xslt')
-rw-r--r-- | xslt/manualcsv2xml.xslt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/xslt/manualcsv2xml.xslt b/xslt/manualcsv2xml.xslt index 736b8b24c..7e138d1e0 100644 --- a/xslt/manualcsv2xml.xslt +++ b/xslt/manualcsv2xml.xslt @@ -61,12 +61,17 @@ <xsl:param name="line"/> <xsl:variable name="number"> - <xsl:if test="$numberField >= 0"> - <xsl:call-template name="getFieldByIndex"> - <xsl:with-param name="index" select="$numberField"/> - <xsl:with-param name="line" select="$line"/> - </xsl:call-template> - </xsl:if> + <xsl:choose> + <xsl:when test="$numberField >= 0"> + <xsl:call-template name="getFieldByIndex"> + <xsl:with-param name="index" select="$numberField"/> + <xsl:with-param name="line" select="$line"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="'0'"/> + </xsl:otherwise> + </xsl:choose> </xsl:variable> <xsl:if test="$number >= 0"> |