summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-07-27 16:13:28 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-27 06:34:04 -0700
commit02488ba9df26eec8e5ec4dbd352880bf6b16c416 (patch)
treeb8ec9e8ad3f831cd30691b253ba1f0327702ec98 /xslt
parent615f45e58b13f0c025155e53834e1491e0112aac (diff)
downloadsubsurface-02488ba9df26eec8e5ec4dbd352880bf6b16c416.tar.gz
CSV import: add XSLT support for DC hw info
Include the DC's hardware name if it was given as parameter on CSV import. 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/csv2xml.xslt15
1 files changed, 14 insertions, 1 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index f2d652ec2..dda876a7b 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -21,6 +21,7 @@
<xsl:param name="units" select="units"/>
<xsl:param name="separatorIndex" select="separatorIndex"/>
<xsl:param name="delta" select="delta"/>
+ <xsl:param name="hw" select="hw"/>
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="lf"><xsl:text>
@@ -51,7 +52,19 @@
<cylinder description='diluent' o2="21.0%" use='diluent' />
</xsl:if>
- <divecomputer model="Imported from CSV" deviceid="ffffffff">
+ <divecomputer deviceid="ffffffff">
+ <xsl:choose>
+ <xsl:when test="string-length($hw) &gt; 0">
+ <xsl:attribute name="model">
+ <xsl:value-of select="$hw" />
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="model">
+ <xsl:value-of select="'Imported from CSV'" />
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:if test="$po2Field >= 0 or $setpointField >= 0 or $o2sensor1Field >= 0 or $o2sensor2Field >= 0 or $o2sensor3Field >= 0">
<xsl:attribute name="dctype">CCR</xsl:attribute>
<xsl:attribute name="no_o2sensors">