<xsl:value-of select="format-number(number($input-normal-mean/text() * $input-normal-mean/@values-count + $merge-normal-mean/text()) div number($input-normal-mean/@values-count + 1), '0.0')" />
</xsl:copy>
</xsl:when>
- <xsl:when test="$input-normal-mean and (not($merge-normal-mean) or $merge-normal-mean/text() = '')">
+ <xsl:when test="$input-normal-mean != '' and (not($merge-normal-mean) or $merge-normal-mean = '')">
<xsl:copy>
<xsl:apply-templates select="$input-normal-mean/@*" />
<xsl:apply-templates select="$input-normal-mean/node()" />
</xsl:copy>
</xsl:when>
- <xsl:when test="not($input-normal-mean) and $merge-normal-mean and $merge-normal-mean/text() != ''">
+ <xsl:when test="(not($input-normal-mean) or $input-normal-mean = '') and $merge-normal-mean and $merge-normal-mean != ''">
<xsl:copy>
<xsl:apply-templates select="$merge-normal-mean/@*" />
<xsl:attribute name="values-count">1</xsl:attribute>
<xsl:apply-templates select="$merge-normal-mean/node()" />
</xsl:copy>
</xsl:when>
+ <xsl:when test="$input-normal-mean = '' and $merge-normal-mean = ''">
+ <xsl:copy>
+ <xsl:apply-templates select="$input-normal-mean/@*" />
+ <xsl:apply-templates select="$input-normal-mean/node()" />
+ </xsl:copy>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="no">
+ <xsl:value-of select="concat($month, '-', $day, ' - normalMean: ', $input-normal-mean, ' ', $merge-normal-mean)" />
+ </xsl:message>
+ <xsl:message terminate="yes">Trapping case not supposed to happend.</xsl:message>
+ </xsl:otherwise>
</xsl:choose>
</xsl:template>