diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2016-01-24 22:19:06 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-26 09:21:25 +0100 |
commit | e8afb7120c0f81a647d46252f4781946e955d1fb (patch) | |
tree | 8e3cf2979aea427c38dfd3dd6d1c29deb3044861 | |
parent | 7ae578ae6a9b588009a8b1e90db484531c6690a9 (diff) | |
download | subsurface-e8afb7120c0f81a647d46252f4781946e955d1fb.tar.gz |
Support PSI on CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | xslt/csv2xml.xslt | 18 |
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> |