summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-12-20 21:23:31 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-20 11:30:18 -0800
commitcdb3c87b5d7ab2ece5cfe18e2b4861eb23188f53 (patch)
treef118c7f14c76bb21719e3dfc4be1aab52859a48e /xslt
parent3343634fc9e285caa163be2500a2119aeae68a4a (diff)
downloadsubsurface-cdb3c87b5d7ab2ece5cfe18e2b4861eb23188f53.tar.gz
Add cylinder support to manual2xml XSLT
This adds support for importing cylinder information from manually kept dive logs. However, this cannot be used before GUI counterpart is added. 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/manualcsv2xml.xslt50
1 files changed, 50 insertions, 0 deletions
diff --git a/xslt/manualcsv2xml.xslt b/xslt/manualcsv2xml.xslt
index 60a239d46..ac9d5c354 100644
--- a/xslt/manualcsv2xml.xslt
+++ b/xslt/manualcsv2xml.xslt
@@ -21,6 +21,11 @@
<xsl:param name="dateformat" select="dateformat"/>
<xsl:param name="airtempField" select="airtempField"/>
<xsl:param name="watertempField" select="watertempField"/>
+ <xsl:param name="cylindersizeField" select="cylindersizeField"/>
+ <xsl:param name="startpressureField" select="startpressureField"/>
+ <xsl:param name="endpressureField" select="endpressureField"/>
+ <xsl:param name="o2Field" select="o2Field"/>
+ <xsl:param name="heField" select="heField"/>
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:variable name="lf"><xsl:text>
@@ -208,6 +213,51 @@
</temperature>
</xsl:if>
+ <xsl:if test="$cylindersizeField &gt; 0 or $startpressureField &gt; 0 or $endpressureField &gt; 0 or o2Field &gt;0 or heField &gt; 0">
+ <cylinder>
+ <xsl:if test="$cylindersizeField &gt; 0">
+ <xsl:attribute name="size">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$cylindersizeField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$startpressureField &gt; 0">
+ <xsl:attribute name="start">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$startpressureField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$endpressureField &gt; 0">
+ <xsl:attribute name="end">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$endpressureField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$o2Field &gt; 0">
+ <xsl:attribute name="o2">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$o2Field"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$heField &gt; 0">
+ <xsl:attribute name="he">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$heField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ </cylinder>
+ </xsl:if>
+
<xsl:if test="$maxDepthField >= 0 or $meanDepthField >= 0">
<depth>
<xsl:if test="$maxDepthField >= 0">