summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-04 15:19:28 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-04 15:27:09 -0800
commitb5d3476b0ba881699c604a3d97c5801b8bb99a08 (patch)
tree788be1551df2a7f26e2aa2e905994250e0d929af /xslt
parent5fc50b2aaba122bf0c7b4251565800aec7a1e4a1 (diff)
downloadsubsurface-b5d3476b0ba881699c604a3d97c5801b8bb99a08.tar.gz
Allow comma separated CSV files
The separator selector in the CSV import dialog was unused. This passes the value into the xslt and adds ',' as possible value. I'm sure this could be done much better (pass the actual character instead of the index), but I couldn't get that to work and this does seem to do the trick. Also added a test dive to test this feature. Fixes #321 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r--xslt/csv2xml.xslt8
1 files changed, 7 insertions, 1 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index fda0b6724..7ddbda92d 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -11,11 +11,17 @@
<xsl:param name="stopdepthField" select="stopdepthField"/>
<xsl:param name="date" select="date"/>
<xsl:param name="time" select="time"/>
+ <xsl:param name="separatorIndex" select="separatorIndex"/>
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="lf"><xsl:text>
</xsl:text></xsl:variable>
- <xsl:variable name="fs"><xsl:text> </xsl:text></xsl:variable>
+ <xsl:variable name="fs">
+ <xsl:choose>
+ <xsl:when test="$separatorIndex = 0"><xsl:text> </xsl:text></xsl:when>
+ <xsl:otherwise><xsl:text>,</xsl:text></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:template match="/">
<divelog program="subsurface-import" version="2">