summaryrefslogtreecommitdiffstats
path: root/xslt/MacDive.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-05-04 20:03:23 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-04 10:55:24 -0700
commit4f5db4a11f840d3e471baccad8bd457c618d67ea (patch)
treee5f1d8d27d548fd029d71a19b80044c295800acf /xslt/MacDive.xslt
parent6cd71882f259d00501e4af66b1238e61978787d5 (diff)
downloadsubsurface-4f5db4a11f840d3e471baccad8bd457c618d67ea.tar.gz
Re-order the MacDive import
Next commit will do indentation so this one will keep it clear of what actually occurs. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'xslt/MacDive.xslt')
-rw-r--r--xslt/MacDive.xslt162
1 files changed, 81 insertions, 81 deletions
diff --git a/xslt/MacDive.xslt b/xslt/MacDive.xslt
index c2c3ba187..1f6b157d8 100644
--- a/xslt/MacDive.xslt
+++ b/xslt/MacDive.xslt
@@ -66,49 +66,6 @@
</xsl:call-template>
</xsl:attribute>
- <xsl:choose>
- <xsl:when test="maxdepth != ''">
- <depth>
- <xsl:attribute name="max">
- <xsl:call-template name="depthConvert">
- <xsl:with-param name="depth">
- <xsl:value-of select="maxdepth"/>
- </xsl:with-param>
- <xsl:with-param name="units" select="$units"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="mean">
- <xsl:call-template name="depthConvert">
- <xsl:with-param name="depth">
- <xsl:value-of select="avgdepth"/>
- </xsl:with-param>
- <xsl:with-param name="units" select="$units"/>
- </xsl:call-template>
- </xsl:attribute>
- </depth>
- </xsl:when>
- <xsl:otherwise>
- <depth>
- <xsl:attribute name="max">
- <xsl:call-template name="depthConvert">
- <xsl:with-param name="depth">
- <xsl:value-of select="maxDepth"/>
- </xsl:with-param>
- <xsl:with-param name="units" select="$units"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="mean">
- <xsl:call-template name="depthConvert">
- <xsl:with-param name="depth">
- <xsl:value-of select="averageDepth"/>
- </xsl:with-param>
- <xsl:with-param name="units" select="$units"/>
- </xsl:call-template>
- </xsl:attribute>
- </depth>
- </xsl:otherwise>
- </xsl:choose>
-
<xsl:variable name="delta">
<xsl:value-of select="sampleInterval"/>
</xsl:variable>
@@ -175,12 +132,6 @@
<xsl:value-of select="notes"/>
</notes>
- <divecomputer deviceid="ffffffff">
- <xsl:attribute name="model">
- <xsl:value-of select="computer"/>
- </xsl:attribute>
- </divecomputer>
-
<xsl:if test="o2percent != ''">
<cylinder>
<xsl:attribute name="o2">
@@ -243,6 +194,87 @@
</cylinder>
</xsl:for-each>
+ <xsl:if test="diveMaster">
+ <divemaster>
+ <xsl:value-of select="diveMaster"/>
+ </divemaster>
+ </xsl:if>
+ <buddy>
+ <xsl:for-each select="buddies/buddy">
+ <xsl:choose>
+ <xsl:when test="following-sibling::*[1] != ''">
+ <xsl:value-of select="concat(., ', ')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </buddy>
+
+ <xsl:if test="weight != ''">
+ <weightsystem>
+ <xsl:attribute name="weight">
+ <xsl:call-template name="weightConvert">
+ <xsl:with-param name="weight" select="translate(weight, ',', '.')"/>
+ <xsl:with-param name="units" select="$units"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="description">
+ <xsl:value-of select="'unknown'"/>
+ </xsl:attribute>
+ </weightsystem>
+ </xsl:if>
+
+ <divecomputer deviceid="ffffffff">
+ <xsl:attribute name="model">
+ <xsl:value-of select="computer"/>
+ </xsl:attribute>
+ </divecomputer>
+
+ <xsl:choose>
+ <xsl:when test="maxdepth != ''">
+ <depth>
+ <xsl:attribute name="max">
+ <xsl:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="maxdepth"/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="$units"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="mean">
+ <xsl:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="avgdepth"/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="$units"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </depth>
+ </xsl:when>
+ <xsl:otherwise>
+ <depth>
+ <xsl:attribute name="max">
+ <xsl:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="maxDepth"/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="$units"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="mean">
+ <xsl:call-template name="depthConvert">
+ <xsl:with-param name="depth">
+ <xsl:value-of select="averageDepth"/>
+ </xsl:with-param>
+ <xsl:with-param name="units" select="$units"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </depth>
+ </xsl:otherwise>
+ </xsl:choose>
+
<temperature>
<!-- If we have temperature reading and it is non-zero, we use
@@ -304,38 +336,6 @@
</xsl:if>
</temperature>
- <xsl:if test="diveMaster">
- <divemaster>
- <xsl:value-of select="diveMaster"/>
- </divemaster>
- </xsl:if>
- <buddy>
- <xsl:for-each select="buddies/buddy">
- <xsl:choose>
- <xsl:when test="following-sibling::*[1] != ''">
- <xsl:value-of select="concat(., ', ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </buddy>
-
- <xsl:if test="weight != ''">
- <weightsystem>
- <xsl:attribute name="weight">
- <xsl:call-template name="weightConvert">
- <xsl:with-param name="weight" select="translate(weight, ',', '.')"/>
- <xsl:with-param name="units" select="$units"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="description">
- <xsl:value-of select="'unknown'"/>
- </xsl:attribute>
- </weightsystem>
- </xsl:if>
-
<xsl:for-each select="samples/sample">
<sample>
<xsl:attribute name="time">