summaryrefslogtreecommitdiffstats
path: root/xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2016-01-24 22:19:06 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-24 21:26:03 -0800
commitdf6eff917c351221c7c48557803f16ea5872f599 (patch)
treecbd7bd59fad993968b84a5305b12393375ca8cfe /xslt
parent6a4fbecea5fa6db6095c99133dd5fe621607b0d6 (diff)
downloadsubsurface-df6eff917c351221c7c48557803f16ea5872f599.tar.gz
Support PSI 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.xslt18
1 files changed, 14 insertions, 4 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index 2d48de150..903f45535 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -334,10 +334,20 @@
<xsl:if test="$pressureField >= 0">
<xsl:attribute name="pressure">
- <xsl:call-template name="getFieldByIndex">
- <xsl:with-param name="index" select="$pressureField"/>
- <xsl:with-param name="line" select="$line"/>
- </xsl:call-template>
+ <xsl:variable name="pressure">
+ <xsl:call-template name="getFieldByIndex">
+ <xsl:with-param name="index" select="$pressureField"/>
+ <xsl:with-param name="line" select="$line"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$units = 0">
+ <xsl:value-of select="$pressure"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(format-number(($pressure div 14.5037738007), '#'), ' bar')"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:attribute>
</xsl:if>
</sample>