summaryrefslogtreecommitdiffstats
path: root/xslt/csv2xml.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-01-15 21:17:29 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 09:37:28 +0700
commitdd3261f2323c130fc2ffbe0af69e0100581bec0c (patch)
tree904b7b2837cab93c697d9dc00f6178608b77576e /xslt/csv2xml.xslt
parentbdecafc86a7c03d818283df2ca132373a9b888d9 (diff)
downloadsubsurface-dd3261f2323c130fc2ffbe0af69e0100581bec0c.tar.gz
Grab also the last column in CSV when requested
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/csv2xml.xslt')
-rw-r--r--xslt/csv2xml.xslt12
1 files changed, 8 insertions, 4 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index 5c524f668..eb4c8761e 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -88,9 +88,6 @@
</xsl:call-template>
</xsl:variable>
- <!-- First field should be dive time. If the value is not numeric,
- we'll skip it. (We do also allow time in h:m:s notation.) -->
-
<xsl:if test="number($value) = $value or number(substring-before($value, ':')) = substring-before($value, ':')">
<sample>
<xsl:attribute name="time">
@@ -192,7 +189,14 @@
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="substring-before($line,$fs)"/>
+ <xsl:choose>
+ <xsl:when test="substring-before($line,$fs) != ''">
+ <xsl:value-of select="substring-before($line,$fs)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$line"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>