diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-01-24 17:03:13 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-24 14:50:16 -0800 |
commit | 6c825785401ea3e450795db8887eba9444c9b7b5 (patch) | |
tree | fdd20bdc4f6d72ecf9cb2194dbb6bb35085498cf /xslt | |
parent | 6fb0465654cb7954a2abe822d1b48b31299104c0 (diff) | |
download | subsurface-6c825785401ea3e450795db8887eba9444c9b7b5.tar.gz |
Switching to tab delimited CSV export
Use tab as separator when exporting dive details to CSV file. This also
replaces tabs and line feeds from notes with spaces.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/xml2manualcsv.xslt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xslt/xml2manualcsv.xslt b/xslt/xml2manualcsv.xslt index d766c78ec..88762f6a8 100644 --- a/xslt/xml2manualcsv.xslt +++ b/xslt/xml2manualcsv.xslt @@ -6,7 +6,9 @@ <xsl:param name="units" select="units"/> <xsl:output method="text" encoding="UTF-8"/> - <xsl:variable name="fs">,</xsl:variable> + <xsl:variable name="fs"><xsl:text> </xsl:text></xsl:variable> + <xsl:variable name="lf"><xsl:text> +</xsl:text></xsl:variable> <xsl:template match="/divelog/dives"> <xsl:value-of select="concat('"dive number"', $fs, '"date"', $fs, '"time"', $fs, '"duration"', $fs, '"maxdepth"', $fs, '"avgdepth"', $fs, '"airtemp"', $fs, '"watertemp"', $fs, '"cylinder size"', $fs, '"startpressure"', $fs, '"endpressure"', $fs, '"o2"', $fs, '"he"', $fs, '"location"', $fs, '"gps"', $fs, '"divemaster"', $fs, '"buddy"', $fs, '"suit"', $fs, '"rating"', $fs, '"visibility"', $fs, '"notes"', $fs, '"weight"', $fs, '"tags"')"/> @@ -279,7 +281,7 @@ <xsl:template match="notes"> <xsl:value-of select="$fs"/> <xsl:text>"</xsl:text> - <xsl:value-of select="."/> + <xsl:value-of select="translate(translate(., $fs, ' '), $lf, ' ')"/> <xsl:text>"</xsl:text> </xsl:template> </xsl:stylesheet> |