cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koen Pellegrims" <koen.pellegr...@pandora.be>
Subject RE: Found bug in XSLTC
Date Sat, 13 Jul 2002 15:46:55 GMT
I think this bug might be due to lazy type converions in XSLTC. Have you
tried passing the numbers into the numbers()-function before the comparison,
i.e.: <xsl:value-of select="number($var) &lt; number(3)"/> ?

The assignment through the if-construct makes $var into a result-set; I'm
not sure if XSLTC handles the type-conversions very well...

K.

> -----Oorspronkelijk bericht-----
> Van: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net]
> Verzonden: zaterdag 13 juli 2002 17:28
> Aan: xalan-dev@xml.apache.org; Tom.Amiro@Sun.COM; Glenn.Miller@Sun.COM
> CC: morten@xml.apache.org; jacek_ambroziak@yahoo.com;
> cocoon-dev@xml.apache.org; 'Ivelin Ivanov'
> Onderwerp: Found bug in XSLTC
>
>
> Hi all,
>
> Found a bug in XSLTC, version from
> http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-cocoon2/lib/core/xsltc.
> jar?rev=HEAD&content-type=text/plain.
>
> Here is XSLT reproducing the bug:
> ----------8<----------
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:param name="var">
>     <xsl:if test="1 = 1">2</xsl:if>
>   </xsl:param>
>
>   <xsl:param name="var2" select="string($var)"/>
>
>   <xsl:template match="/">
>     Value of var: <xsl:value-of select="$var"/>
>     var is greater then 3: <xsl:value-of select="$var &gt; 3"/>
>     var is less then 3: <xsl:value-of select="$var &lt; 3"/>
>
>     Value of var2: <xsl:value-of select="$var2"/>
>     var2 is greater then 3: <xsl:value-of select="$var2 &gt; 3"/>
>     var2 is less then 3: <xsl:value-of select="$var2 &lt; 3"/>
>   </xsl:template>
> </xsl:stylesheet>
> ----------8<----------
>
>
> Output:
> ----------8<----------
>     Value of var: 2
>     var is greater then 3: false
>     var is less then 3: false
>
>     Value of var2: 2
>     var2 is greater then 3: false
>     var2 is less then 3: true
> ----------8<----------
>
> All other XSLT processors (Xalan, SAXON) produce output:
> ----------8<----------
>     Value of var: 2
>     var is greater then 3: false
>     var is less then 3: true
>
>     Value of var2: 2
>     var2 is greater then 3: false
>     var2 is less then 3: true
> ----------8<----------
>
>
> Regards,
> Vadim
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message