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