[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Beginner's question: Mathematical Calculations in

Subject: Re: Beginner's question: Mathematical Calculations in XSL Template
From: Michael Case <mecase@xxxxxxxxxxx>
Date: Wed, 21 Nov 2001 10:02:06 -0800
expected token eof found number
also, even in XSL, wouldn't number('abc1') return NaN in at least some
processors?

"Ami D. Yanero" wrote:
> 
> I'm attempting to do multiplication and additon calculations in my XSL
> template.  I've seen several posts to various newsgroups about this same
> scenario, and I've tested my calculations using the examples and
> corrected answers posted.
> 
> However, I'm getting the same error when I do the calculations with the
> examples as I'm getting when I use my 'live' documents.  Everything that
> I've read says that what I've got should work.  Please help!
> 
> Thanks in advance.
> 
> Ami D. Yanero, MCP
> Software Developer, McGee Corporation
> P: 704.882.1500 x409
> F: 704.882.0219
> E: AmiY@xxxxxxxxxxxxx
> **********************************************
> "Man is still the most extraordinary computer."
>                            --John F. Kennedy
> +-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/+-*/
> +-*/+-*/+-*/+-*/+-*/
> 
> Error:
> ======
> Expected token 'eof' found '*'. number(one) -->*<-- number(two) *
> number(three)
> 
> XML Doc:
> ========
> <?xml version = "1.0" encoding = "UTF-8"?>
> <?xml-stylesheet href = 'file:///P:/Projects/QuickQuote/test.xsl' type =
> 'text/xsl'?>
> <numbers>
>         <one>abc1</one>
>         <two>2</two>
>         <three>3</three>
> </numbers>
> 
> XSL Doc:
> ========
> <?xml version="1.0" ?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
> <xsl:template match="/">
> <html>
> <body>
> <font face="arial">
> <xsl:for-each select="numbers">
> <table width="100%" cellpadding="1" cellspacing="0"
> bordercolor="#c0c0c0">
>     <tr>
>         <td valign="top"><strong>One: </strong></td>
>         <td valign="top"><xsl:value-of select="one" /></td>
>     </tr>
>     <tr>
>         <td valign="top"><strong>Two: </strong></td>
>         <td valign="top"><xsl:value-of select="two" /></td>
>     </tr>
>     <tr>
>         <td valign="top"><strong>Three: </strong></td>
>         <td valign="top"><xsl:value-of select="three" /></td>
>     </tr>
>     <tr>
>         <td valign="top"><strong>Added: </strong></td>
>         <td valign="top">
> <xsl:value-of select="number(one) * number(two) * number(three)"/>
>         </td>
> 
>     </tr>
> </table>
> </xsl:for-each>
> </font>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 

Michael E. Case
UC Davis
case@xxxxxxxxxxxxxxxxxx
(530) 754-7226

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.