summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
Diffstat (limited to 'xslt')
-rw-r--r--xslt/uddf-export.xslt130
1 files changed, 64 insertions, 66 deletions
diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index d1d46a9b9..4365702dc 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -279,11 +279,75 @@
<xsl:value-of select="format-number(substring-before(., ' ') + 273.15, '0.00')"/>
</airtemperature>
</xsl:for-each>
+ <xsl:variable name="trimmedweightlist">
+ <xsl:for-each select="weightsystem">
+ <weight>
+ <xsl:value-of select="substring-before(@weight, ' ')"/>
+ </weight>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:if test="sum(xt:node-set($trimmedweightlist)/node()) >= 0">
+ <equipmentused>
+ <leadquantity>
+ <xsl:value-of select="sum(xt:node-set($trimmedweightlist)/node())"/>
+ </leadquantity>
+ </equipmentused>
+ </xsl:if>
<xsl:if test="parent::trip">
<tripmembership ref="trip{generate-id(..)}"/>
</xsl:if>
</informationbeforedive>
+ <xsl:for-each select="cylinder">
+ <tankdata>
+ <link>
+ <xsl:attribute name="ref">
+ <xsl:choose>
+ <xsl:when test="@o2 != ''">
+ <xsl:value-of select="concat('mix', substring-before(@o2, '.'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'mix21'"/>
+ </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="@start">
+ <tankpressurebegin>
+ <xsl:value-of select="substring-before(@start, ' ') * 100000"/>
+ </tankpressurebegin>
+ </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="@end">
+ <tankpressureend>
+ <xsl:value-of select="substring-before(@end, ' ') * 100000"/>
+ </tankpressureend>
+ </xsl:when>
+ <xsl:otherwise>
+ <tankpressureend>
+ <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
+ </tankpressureend>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </tankdata>
+ </xsl:for-each>
+
<samples>
<xsl:for-each select="divecomputer[1]/event | divecomputer[1]/sample">
@@ -483,65 +547,7 @@
</xsl:for-each>
</samples>
- <xsl:for-each select="cylinder">
- <tankdata>
- <link>
- <xsl:attribute name="ref">
- <xsl:choose>
- <xsl:when test="@o2 != ''">
- <xsl:value-of select="concat('mix', substring-before(@o2, '.'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'mix21'"/>
- </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="@start">
- <tankpressurebegin>
- <xsl:value-of select="substring-before(@start, ' ') * 100000"/>
- </tankpressurebegin>
- </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="@end">
- <tankpressureend>
- <xsl:value-of select="substring-before(@end, ' ') * 100000"/>
- </tankpressureend>
- </xsl:when>
- <xsl:otherwise>
- <tankpressureend>
- <xsl:value-of select="substring-before(divecomputer[1]/sample[@pressure][last()]/@pressure, ' ') * 100000"/>
- </tankpressureend>
- </xsl:otherwise>
- </xsl:choose>
-
- </tankdata>
- </xsl:for-each>
-
<informationafterdive>
- <xsl:variable name="trimmedweightlist">
- <xsl:for-each select="weightsystem">
- <weight>
- <xsl:value-of select="substring-before(@weight, ' ')"/>
- </weight>
- </xsl:for-each>
- </xsl:variable>
-
<xsl:if test="node()/depth/@max != ''">
<greatestdepth>
<xsl:value-of select="substring-before(node()/depth/@max, ' ')"/>
@@ -605,14 +611,6 @@
</xsl:when>
</xsl:choose>
</visibility>
- <equipmentused>
- <leadquantity>
- <xsl:if test="sum(xt:node-set($trimmedweightlist)/node()) >= 0">
- <xsl:value-of select="sum(xt:node-set($trimmedweightlist)/node())"/>
- </xsl:if>
- </leadquantity>
- </equipmentused>
-
</informationafterdive>
</dive>