aboutsummaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Martin Long <martin@longhome.co.uk>2014-12-13 00:34:40 +0000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-12 18:27:18 -0800
commit5a3b010586e99711a2363cc1665ea4bfc3851e58 (patch)
tree95797f557e0def4b258e24053d1881df1e58b1b8 /xslt
parent6c891c02e5fcc73b12ab7d6c778681acc8de6cb2 (diff)
downloadsubsurface-5a3b010586e99711a2363cc1665ea4bfc3851e58.tar.gz
Fix bug in tankpressurebegin in UDDF export
There was a bug when the first sample doesn't contain pressure info. This fixes that by selecting the first with pressure info. Signed-off-by: Martin Long <martin@longhome.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt')
-rw-r--r--xslt/uddf-export.xslt29
1 files changed, 13 insertions, 16 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index 4e1b4144e..8a24f0ebe 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -475,37 +475,34 @@
</link>
<xsl:if test="@size">
+
<tankvolume>
<xsl:value-of select="substring-before(@size, ' ')"/>
</tankvolume>
</xsl:if>
<xsl:choose>
- <xsl:when test="divecomputer[1]/sample/@pressure != ''">
- <tankpressurebegin>
- <xsl:value-of select="substring-before(divecomputer[1]/sample/@pressure[1], ' ') * 100000"/>
- </tankpressurebegin>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="@start">
+ <xsl:when test="@start">
<tankpressurebegin>
<xsl:value-of select="substring-before(@start, ' ') * 100000"/>
</tankpressurebegin>
- </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <tankpressurebegin>
+ <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure]/@pressure[1], ' ') * 100000"/>
+ </tankpressurebegin>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
- <xsl:when test="count(divecomputer[1]/sample[@pressure]) &gt; 0">
- <tankpressureend>
- <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
- </tankpressureend>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="@end">
+ <xsl:when test="@end">
<tankpressureend>
<xsl:value-of select="substring-before(@end, ' ') * 100000"/>
</tankpressureend>
- </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <tankpressureend>
+ <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
+ </tankpressureend>
</xsl:otherwise>
</xsl:choose>