diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2014-12-26 16:11:36 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-12-26 08:43:30 -0800 |
commit | e750eb1686db3280aacb0b5196840af706226909 (patch) | |
tree | 9805cff71bfcdcdf050f2a16a5e8e9e3dc7539cd /xslt | |
parent | 0b040b769de4f566c95abc5dcd2c3216b2f3c399 (diff) | |
download | subsurface-e750eb1686db3280aacb0b5196840af706226909.tar.gz |
Export total weight on CSV export
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 | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/xslt/xml2manualcsv.xslt b/xslt/xml2manualcsv.xslt index b2060615d..000149ac4 100644 --- a/xslt/xml2manualcsv.xslt +++ b/xslt/xml2manualcsv.xslt @@ -1,12 +1,14 @@ <?xml version="1.0"?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xt="http://www.jclark.com/xt" + extension-element-prefixes="xt" version="1.0"> <xsl:strip-space elements="*"/> <xsl:output method="text" encoding="UTF-8"/> <xsl:variable name="fs">,</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"')"/> + <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"')"/> <xsl:text> </xsl:text> <xsl:apply-templates select="dive|trip/dive"/> @@ -99,6 +101,21 @@ <xsl:value-of select="$fs"/> <xsl:text>""</xsl:text> </xsl:if> + + <xsl:variable name="trimmedweightlist"> + <xsl:for-each select="weightsystem"> + <weight> + <xsl:value-of select="substring-before(@weight, ' ')"/> + </weight> + </xsl:for-each> + </xsl:variable> + <xsl:value-of select="$fs"/> + <xsl:text>"</xsl:text> + <xsl:if test="weightsystem"> + <xsl:value-of select="concat(sum(xt:node-set($trimmedweightlist)/node()), ' kg')"/> + </xsl:if> + <xsl:text>"</xsl:text> + <xsl:text> </xsl:text> </xsl:template> |