Reputation: 1
I have updated Saxon from version9 to version10. But for the same Xsl code getting different result. In Saxon10 by default its considering input parameter as string, But in Saxon9 its considering input parameter as number value. This is the expected behavior or something is wrong with input?
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:param name="var.variable1"/>
<xsl:template match="/">
<result>
<xsl:choose>
<xsl:when test="(/TestData/amount < number($var.variable1) or /TestData/amount = number($var.variable1))"> <CompValue>true</CompValue>
</xsl:when>
<xsl:otherwise>
<CompValue>false</CompValue>
</xsl:otherwise>
</xsl:choose>
<amount>
<xsl:value-of select="/TestData/amount/text()"/>
</amount>
<var1>
<xsl:value-of select="number($var.variable1)"/>
</var1>
</result>
</xsl:template>
</xsl:stylesheet>```
Input data:
<?xml version="1.0" encoding="UTF-8"?>
<TestData><amount>555</amount></TestData>
Saxon 9 Output:
<?xml version="1.0" encoding="UTF-8"?>
<result><CompValue>false</CompValue><amount>555</amount><var1>NaN</var1></result>
Saxon 10 Output:
<?xml version="1.0" encoding="UTF-8"?>
<result><CompValue>true</CompValue><amount>555</amount><var1>NaN</var1></result>
Upvotes: 0
Views: 57