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>
<xsl:if test="$pressureField >= 0"> <xsl:if test="$pressureField >= 0">
<xsl:attribute name="pressure"> <xsl:variable name="pressure">
<xsl:variable name="pressure"> <xsl:call-template name="getFieldByIndex">
<xsl:call-template name="getFieldByIndex"> <xsl:with-param name="index" select="$pressureField"/>
<xsl:with-param name="index" select="$pressureField"/> <xsl:with-param name="line" select="$line"/>
<xsl:with-param name="line" select="$line"/> </xsl:call-template>
</xsl:call-template> </xsl:variable>
</xsl:variable> <xsl:if test="$pressure >= 0">
<xsl:if test="$pressure >= 0"> <xsl:attribute name="pressure">
<xsl:choose> <xsl:choose>
<xsl:when test="$units = 0"> <xsl:when test="$units = 0">
<xsl:value-of select="$pressure"/> <xsl:value-of select="$pressure"/>
@ -428,8 +428,8 @@
<xsl:value-of select="concat(format-number(($pressure div 14.5037738007), '#'), ' bar')"/> <xsl:value-of select="concat(format-number(($pressure div 14.5037738007), '#'), ' bar')"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:if> </xsl:attribute>
</xsl:attribute> </xsl:if>
</xsl:if> </xsl:if>
</sample> </sample>
</xsl:if> </xsl:if>