mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Fix XSLT when no weight system is given
Summing up weights ended only when there was one parameter left. With no parameters we ended up in an infinite loop. Now we end also in case of no parameters. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
42ea5e3510
commit
f22527fdaf
1 changed files with 7 additions and 0 deletions
|
@ -112,9 +112,16 @@
|
||||||
|
|
||||||
<xsl:variable name="value" select="substring-before($values[1], ' ')"/>
|
<xsl:variable name="value" select="substring-before($values[1], ' ')"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
|
|
||||||
|
<!-- No input -->
|
||||||
|
<xsl:when test="count($values) = 0"/>
|
||||||
|
|
||||||
|
<!-- Handling last value -->
|
||||||
<xsl:when test="count($values) = 1">
|
<xsl:when test="count($values) = 1">
|
||||||
<xsl:value-of select="format-number($value + $sum, '#.#')"/>
|
<xsl:value-of select="format-number($value + $sum, '#.#')"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
|
||||||
|
<!-- More than one value to sum -->
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:call-template name="sum">
|
<xsl:call-template name="sum">
|
||||||
<xsl:with-param name="values" select="$values[position() > 1]"/>
|
<xsl:with-param name="values" select="$values[position() > 1]"/>
|
||||||
|
|
Loading…
Reference in a new issue