summaryrefslogtreecommitdiffstats
path: root/xslt/csv2xml.xslt
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-03-30 07:10:36 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-04-01 08:06:09 -0700
commitb919a9d700ce6ef0ad2bf8e887500ffd61c4f8cf (patch)
tree4c94475f2a87da90b362427ffd56f6b46e05691d /xslt/csv2xml.xslt
parent1aced1302577ded847f48cbbafa6b1a5c8558061 (diff)
downloadsubsurface-b919a9d700ce6ef0ad2bf8e887500ffd61c4f8cf.tar.gz
Add the pressure attribute only if it exists
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt/csv2xml.xslt')
-rw-r--r--xslt/csv2xml.xslt20
1 files changed, 10 insertions, 10 deletions
diff --git a/xslt/csv2xml.xslt b/xslt/csv2xml.xslt
index fa1cd3afb..960f48395 100644
--- a/xslt/csv2xml.xslt
+++ b/xslt/csv2xml.xslt
@@ -412,14 +412,14 @@
</xsl:if>
<xsl:if test="$pressureField >= 0">
- <xsl:attribute name="pressure">
- <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:if test="$pressure >= 0">
+ <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:if test="$pressure >= 0">
+ <xsl:attribute name="pressure">
<xsl:choose>
<xsl:when test="$units = 0">
<xsl:value-of select="$pressure"/>
@@ -428,8 +428,8 @@
<xsl:value-of select="concat(format-number(($pressure div 14.5037738007), '#'), ' bar')"/>
</xsl:otherwise>
</xsl:choose>
- </xsl:if>
- </xsl:attribute>
+ </xsl:attribute>
+ </xsl:if>
</xsl:if>
</sample>
</xsl:if>