[ http://issues.apache.org/jira/browse/XALANJ-817?page=all ]
Brian Minchau updated XALANJ-817:
---------------------------------
Version: Latest Development Code
(was: 2.2.0)
> Xalan 2.2 mishandles newline in numeric RTF
> -------------------------------------------
>
> Key: XALANJ-817
> URL: http://issues.apache.org/jira/browse/XALANJ-817
> Project: XalanJ2
> Type: Bug
> Components: Xalan
> Versions: Latest Development Code
> Environment: Operating System: Windows NT/2K
> Platform: PC
> Reporter: Richard Pfeiffer
> Assignee: Xalan Developers Mailing List
>
> Xalan is incorrectly processing a result tree fragment in a recursive
> template.
> I am using the following stylesheet (notice the number 3 at the end of
> the line marked "NOTICE THIS NUMBER").
> ---------------- BEGIN STYLESHEET ---------------------
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:template name="total-numbers">
> <xsl:param name="list"/>3<!-- NOTICE THIS NUMBER -->
> <xsl:variable name="wlist"
> select="concat(normalize-space($list), ' ')"/>
> <xsl:choose>
> <xsl:when test="$wlist!=' '">
> <xsl:variable name="first"
> select="substring-before($wlist, ' ')"/>
> <xsl:variable name="rest"
> select="substring-after($wlist, ' ')"/>
> <xsl:variable name="total">
> <xsl:call-template name="total-numbers">
> <xsl:with-param name="list" select="$rest"/>
> </xsl:call-template>
> </xsl:variable>
> <xsl:value-of select="number($first) + number($total)"/>
> </xsl:when>
> <xsl:otherwise>0</xsl:otherwise>
> </xsl:choose>
> </xsl:template>
> <xsl:template match="/">
> <xsl:call-template name="total-numbers">
> <xsl:with-param name="list" select="."/>
> </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>
> ---------------- END STYLESHEET ---------------------
> If I use the following input,
> ---------------- BEGIN INPUT ---------------------
> <numbers>12 34.5 18.2 -35</numbers>
> ---------------- END INPUT ---------------------
> The stylesheet should get output like this:
> ---------------- BEGIN OUTPUT ---------------------
> <?xml version="1.0" encoding="utf-8"?>3
> NaN
> ---------------- END OUTPUT ---------------------
> Instead, the stylesheet output is
> ---------------- BEGIN OUTPUT ---------------------
> <?xml version="1.0" encoding="UTF-8"?>
> 3
> 15
> ---------------- END OUTPUT ---------------------
> This stylesheet came from Michael Kay's book XSLT Programmer's Reference
> (page
> 616 of the second edition), and Michael himself verified that this output
> from
> Xalan is incorrect.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]