mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Export total weight on CSV export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0b040b769d
commit
e750eb1686
1 changed files with 19 additions and 2 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue