Re: [xsl] Beginner's question: Mathematical Calculations in XSL Template

Subject: Re: [xsl] Beginner's question: Mathematical Calculations in XSL Template
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Wed, 21 Nov 2001 13:24:11 -0500
[Ami D. Yanero]

> 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!
 First of all, you need to use an actual xslt processor as others have said.
Then your example works fine (after you use the correct namespace for xslt).
Here's a slightly modified version of your example and stylesheet:

<?xml version = "1.0" encoding = "UTF-8"?>

Here is a working stylesheet and the results:

<xsl:stylesheet version="1.0"

<xsl:template match="/">
 <xsl:apply-templates select='numbers'/>

<xsl:template match='numbers'>
 Addition:<xsl:value-of select='number(one)+number(two)+number(three)'/>


============= results =============




Tom P

 XSL-List info and archive:

Current Thread