summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-01-07 09:58:06 +0200
committerGravatar mturkia <miika.turkia@gmail.com>2018-01-08 06:06:12 +0200
commit5046fa34a499c8f508ac47eede29311dfe56e0fc (patch)
tree083ae5de773777052b31a3c29655e89af31405b9 /xslt
parent4a5b40c14401b8f7d1a25b7538d6abd99f7895b7 (diff)
downloadsubsurface-5046fa34a499c8f508ac47eede29311dfe56e0fc.tar.gz
Add support for max and mean depths for CSV import
Add support of importing max and mean depths from DC header information. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt')
-rw-r--r--xslt/csv2xml.xslt31
1 files changed, 31 insertions, 0 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index fd08c8b57..770455a6f 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -31,6 +31,8 @@
<xsl:param name="Firmware" select="Firmware"/>
<xsl:param name="Serial" select="Serial"/>
<xsl:param name="GF" select="GF"/>
+ <xsl:param name="maxDepth" select="maxDepth"/>
+ <xsl:param name="meanDepth" select="meanDepth"/>
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="lf"><xsl:text>
@@ -189,6 +191,35 @@
</extradata>
</xsl:if>
+ <xsl:if test="string-length($maxDepth) &gt; 0 or string-length($meanDepth) &gt; 0">
+ <depth>
+ <xsl:if test="string-length($maxDepth) &gt; 0">
+ <xsl:attribute name="max">
+ <xsl:choose>
+ <xsl:when test="$units = 0">
+ <xsl:value-of select="translate($maxDepth, ',', '.')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="round(translate(translate($maxDepth, translate($maxDepth, '0123456789,.', ''), ''), ',', '.') * 0.3048 * 1000) div 1000"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($meanDepth) &gt; 0">
+ <xsl:attribute name="mean">
+ <xsl:choose>
+ <xsl:when test="$units = 0">
+ <xsl:value-of select="translate($meanDepth, ',', '.')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="round(translate(translate($meanDepth, translate($meanDepth, '0123456789,.', ''), ''), ',', '.') * 0.3048 * 1000) div 1000"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ </depth>
+ </xsl:if>
+
<xsl:call-template name="printLine">
<xsl:with-param name="line" select="substring-before(//csv, $lf)"/>
<xsl:with-param name="lineno" select="'1'"/>