aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-12-22 23:04:02 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-22 14:23:38 -0800
commit898a62f88837063e0d079dc995f4dad9e87aaf85 (patch)
tree9256d4d3bdf795c0d500e00b36f938e6fb5e3a70
parent74f5842f0c324fdd2d0217e90c11da6c70319f6e (diff)
downloadsubsurface-898a62f88837063e0d079dc995f4dad9e87aaf85.tar.gz
Grab divecomputer/temperature on CSV export
If temperature is recorded by a DC it must be taken from under the divecomputer tag. However, this will prefer the manually written value if such exists. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--xslt/xml2manualcsv.xslt11
1 files changed, 9 insertions, 2 deletions
diff --git a/xslt/xml2manualcsv.xslt b/xslt/xml2manualcsv.xslt
index fa3868cf8..93894a7b5 100644
--- a/xslt/xml2manualcsv.xslt
+++ b/xslt/xml2manualcsv.xslt
@@ -29,7 +29,14 @@
<xsl:value-of select="@duration"/>
<xsl:text>&quot;</xsl:text>
<xsl:apply-templates select="divecomputer/depth"/>
- <xsl:apply-templates select="divetemperature"/>
+ <xsl:choose>
+ <xsl:when test="divetemperature/@air|divetemperature/@water != ''">
+ <xsl:apply-templates select="divetemperature"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="divecomputer[1]/temperature"/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:apply-templates select="cylinder"/>
<xsl:apply-templates select="location"/>
<xsl:apply-templates select="divemaster"/>
@@ -57,7 +64,7 @@
<xsl:value-of select="@mean"/>
<xsl:text>&quot;</xsl:text>
</xsl:template>
- <xsl:template match="divetemperature">
+ <xsl:template match="divetemperature|temperature">
<xsl:value-of select="$fs"/>
<xsl:text>&quot;</xsl:text>
<xsl:value-of select="@air"/>