Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 31st, 2008, 01:08 AM
Authorized User
 
Join Date: Jul 2008
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default xsl calculation

I have values in the xsl:variable with name of toDate, dateFro & numDays. Variables are not possible to calculate.
Is it any option to convert to number or any adive.?

I need to do calculation such as

Reuslt = <xsl:value-of select="($toDate-$dateFro) div $numDays"/>
 
Old July 31st, 2008, 04:03 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

a) Are you getting an error? If so what is it?
b) What version of XSLT are you using?
c) I can't see anything wrong with what you've written, so if you are getting an error then it must be in the code you haven't shown us.

/- Sam Judson : Wrox Technical Editor -/
 
Old July 31st, 2008, 04:34 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If I remember rightly elayaraja is still using XSLT 1.0 despite the fact that he/she is trying to do many things that are much easier in XSLT 2.0.

If you're stuck with 1.0 and need to do date arithmetic then the best bet (other than moving to XSLT 2.0) is to use the library of routines at http://www.exslt.org/

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old July 31st, 2008, 04:59 AM
Authorized User
 
Join Date: Jul 2008
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Michael.Thanks for your reply with lib link.
I would like to share with you, that at this moment i can't move forward to XSL2.0.
[u]XSLT:</u> Version 1.0
[u]Processor:</u> Xalan-C_1_8_0-windows_2000-msvc_60 /xerces-c_2_5_0-windows_nt-msvc_60
[u]Platform: </u>Windows XP





Similar Threads
Thread Thread Starter Forum Replies Last Post
TEMPLATE CALCULATION pallone XSLT 7 December 22nd, 2006 07:20 PM
SQL Calculation mihabib SQL Server 2000 2 January 6th, 2006 06:23 AM
Calculation Grantm Access 3 February 16th, 2004 10:14 AM
Calculation in Report lryckman Access 2 February 10th, 2004 08:44 AM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.