summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-12-28 09:05:36 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-28 07:43:21 -0800
commit16d7f5e86e74db4cb34109a3dcb228d13d389381 (patch)
tree371c08a7a8b86378f69eb6f804b50b70f92b65f7 /xslt
parent683227d2aac7326bab710825fb562630119ac7f9 (diff)
downloadsubsurface-16d7f5e86e74db4cb34109a3dcb228d13d389381.tar.gz
Support for multiple cylinders on UDDF export
Adding support for multiple cylinders on UDDF export. This also adds a cylinder reference to the tankdata to enable mix lookups. 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/uddf-export.xslt79
1 files changed, 47 insertions, 32 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index 3002469c6..e82b29df6 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -359,43 +359,58 @@
</xsl:for-each>
</samples>
- <tankdata>
- <xsl:if test="cylinder[1]/@size">
- <tankvolume>
- <xsl:value-of select="substring-before(cylinder[1]/@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="cylinder[1]/@start">
+ <xsl:for-each select="cylinder">
+ <tankdata>
+ <link>
+ <xsl:attribute name="ref">
+ <xsl:choose>
+ <xsl:when test="@o2 != ''">
+ <xsl:value-of select="substring-before(@o2, '.')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'21'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </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(cylinder[1]/@start, ' ') * 100000"/>
+ <xsl:value-of select="substring-before(divecomputer[1]/sample/@pressure[1], ' ') * 100000"/>
</tankpressurebegin>
- </xsl:if>
- </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="cylinder[1]/@end">
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="@start">
+ <tankpressurebegin>
+ <xsl:value-of select="substring-before(@start, ' ') * 100000"/>
+ </tankpressurebegin>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="count(divecomputer[1]/sample[@pressure]) &gt; 0">
<tankpressureend>
- <xsl:value-of select="substring-before(cylinder[1]/@end, ' ') * 100000"/>
+ <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
</tankpressureend>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="@end">
+ <tankpressureend>
+ <xsl:value-of select="substring-before(@end, ' ') * 100000"/>
+ </tankpressureend>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
- </tankdata>
+ </tankdata>
+ </xsl:for-each>
<informationafterdive>
<xsl:if test="node()/depth/@max != ''">