aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2016-11-09 21:39:23 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-11-15 03:22:28 -0800
commit5402d489c6f2731c7a81f70e359ab3ea0f3d88bf (patch)
tree2b877f14eebe2d7da2a623d70b1b7fa3dea2044b
parent9006802f7274cbd72f45b507c4b9dd62893dacdd (diff)
downloadsubsurface-5402d489c6f2731c7a81f70e359ab3ea0f3d88bf.tar.gz
CSV import: support time with decimal comma
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--xslt/csv2xml.xslt8
1 files changed, 6 insertions, 2 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index 3c62111fb..9ec697a4d 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -214,7 +214,7 @@
</xsl:variable>
- <xsl:if test="number($value) = $value or number(substring-before($value, ':')) = substring-before($value, ':')">
+ <xsl:if test="number(translate($value, ',', '.')) = translate($value, ',', '.') or number(substring-before($value, ':')) = substring-before($value, ':')">
<sample>
<xsl:attribute name="time">
<xsl:choose>
@@ -225,7 +225,7 @@
</xsl:with-param>
</xsl:call-template>
</xsl:when>
- <xsl:when test="number($value) = $value">
+ <xsl:when test="number(translate($value, ',', '.')) = translate($value, ',', '.')">
<!-- We assume time in seconds -->
<xsl:call-template name="sec2time">
@@ -235,6 +235,10 @@
<!-- Well, I suppose it was min.sec -->
<xsl:value-of select="substring-before($value, '.') * 60 + substring-after($value, '.')" />
</xsl:when>
+ <xsl:when test="substring-after($value, ',') != ''">
+ <!-- Well, I suppose it was min.sec -->
+ <xsl:value-of select="substring-before($value, ',') * 60 + substring-after($value, ',')" />
+ </xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>