Add the pressure attribute only if it exists

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
Miika Turkia 2017-03-30 07:10:36 +03:00 committed by Dirk Hohndel
parent 1aced13025
commit b919a9d700

View file

@ -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>