You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Aidan Mark Humphreys <ah...@procoma.de> on 2001/03/29 09:00:03 UTC
Math Problem?
Has anyone seen arithmetical problems in Java Xalan 1.2.2 and Xalan 2.0.1
(using Xerces as parser) ?
The following stylesheet ...
================================================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="varA">50</xsl:variable>
<xsl:variable name="varB">100</xsl:variable>
<xsl:variable name="varC">0.40</xsl:variable>
<xsl:template match="/">
<text1 varA="{$varA}" varB="{$varB}" varC="{$varC}">
varA - varB * varC equals
<xsl:value-of select="$varA - $varB * $varC"/>
</text1>
</xsl:template>
</xsl:stylesheet>
===================================================
yields the following strange numeric output
===================================================
<text1 varC="0.40" varB="100" varA="50">
varA - varB * varC equals
-3950
</text1>
======================================================================
with microsoft's MSXML3 I get the expected
======================================================================
<?xml version="1.0" encoding="UTF-16"?><text1 varA="50" varB="100"
varC="0.40">
varA - varB * varC equals
10
</text1>
======================================================================
I tried parentheses with not result. Any suggestions?
Aidan
Re: Math Problem?
Posted by James Melton <ja...@cylogix.com>.
I'm very interested to take a look at this as soon as I can - perhaps
tonight. It could be good to put this into Bugzilla:
http://nagoya.betaversion.org/bugzilla
Jim.
Aidan Mark Humphreys wrote:
>
> Has anyone seen arithmetical problems in Java Xalan 1.2.2 and Xalan 2.0.1
> (using Xerces as parser) ?
>
> The following stylesheet ...
>
> ================================================
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:variable name="varA">50</xsl:variable>
>
> <xsl:variable name="varB">100</xsl:variable>
>
> <xsl:variable name="varC">0.40</xsl:variable>
>
> <xsl:template match="/">
>
> <text1 varA="{$varA}" varB="{$varB}" varC="{$varC}">
>
> varA - varB * varC equals
>
> <xsl:value-of select="$varA - $varB * $varC"/>
>
> </text1>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
> ===================================================
>
> yields the following strange numeric output
> ===================================================
> <text1 varC="0.40" varB="100" varA="50">
>
> varA - varB * varC equals
>
> -3950
>
> </text1>
>
> ======================================================================
>
> with microsoft's MSXML3 I get the expected
>
> ======================================================================
>
> <?xml version="1.0" encoding="UTF-16"?><text1 varA="50" varB="100"
> varC="0.40">
>
> varA - varB * varC equals
>
> 10
>
> </text1>
>
> ======================================================================
>
> I tried parentheses with not result. Any suggestions?
>
> Aidan
--
____________________________________________________________
James Melton CyLogix
609.750.5190 609.750.5100
james.melton@cylogix.com www.cylogix.com