You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/11/09 23:07:27 UTC
DO NOT REPLY [Bug 4783] New: -
xsltc fails test mk053 with NaN
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4783>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4783
xsltc fails test mk053 with NaN
Summary: xsltc fails test mk053 with NaN
Product: XalanJ2
Version: 2.0.0
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: Other
Component: org.apache.xalan.xsltc
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: tom.amiro@sun.com
This test does call-templates with params, uses the postition function,
does multiplcation, and uses number-format.
Running saxon on mk053
<?xml version="1.0" encoding="utf-8"?>
Total sales value is: $1798.53
Running xt on mk053
<?xml version="1.0" encoding="utf-8"?>
Total sales value is: $1798.53
Running xalan on mk053
<?xml version="1.0" encoding="UTF-8"?>
Total sales value is: $1798.53
Running XSLTC with Xerces Parser on mk053
<?xml version="1.0" encoding="UTF-8" ?>
Total sales value is: NaN
glrr 179 =>cat mk053.xsl
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- Test FileName: mk053.xsl -->
<!-- Source Attribution:
This test was written by Michael Kay and is taken from
'XSLT Programmer's Reference' published by Wrox Press Limited in 2000;
ISBN 1-861003-12-9; copyright Wrox Press Limited 2000; all rights
reserved.
Now updated in the second edition (ISBN 1861005067), http://www.wrox.com.
No part of this book may be reproduced, stored in a retrieval system or
transmitted in any form or by any means - electronic, electrostatic,
mechanical,
photocopying, recording or otherwise - without the prior written
permission of
the publisher, except in the case of brief quotations embodied in
critical articles or reviews.
-->
<!-- Example: booklist.xml, booksales.xsl -->
<!-- Chapter/Page: 8-555 -->
<!-- Purpose: Finding the total sales value -->
<xsl:template name="total-sales-value">
<xsl:param name="list"/>
<xsl:choose>
<xsl:when test="$list">
<xsl:variable name="first" select="$list[1]"/>
<xsl:variable name="total-of-rest">
<xsl:call-template name="total-sales-value">
<xsl:with-param name="list" select="$list[position()!=1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$first/sales * $first/price + $total-of-rest"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/">
<xsl:variable name="total">
<xsl:call-template name="total-sales-value">
<xsl:with-param name="list" select="//book"/>
</xsl:call-template>
</xsl:variable>
Total sales value is: <xsl:value-of select="format-number($total, '$#.00')"/>
</xsl:template>
</xsl:stylesheet>
mk053.xml
<booklist>
<book>
<title>Angela's Ashes</title>
<author>Frank McCourt</author>
<publisher>HarperCollins</publisher>
<isbn>0 00 649840 X</isbn>
<price>6.99</price>
<sales>235</sales>
</book>
<book>
<title>Sword of Honour</title>
<author>Evelyn Waugh</author>
<publisher>Penguin Books</publisher>
<isbn>0 14 018967 X</isbn>
<price>12.99</price>
<sales>12</sales>
</book>
</booklist>