[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Q - Value of param doesn't change !
Subject: Re: [xsl] Q - Value of param doesn't change ! From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 31 May 2005 14:18:29 +0100 |
So, what's your problem? If I run your posted files I get $ saxon j.xml j.xsl <table xmlns:xs="http://www.w3.org/2001/XMLSchema" width="98%" border="0" cellP dding="0" cellSpacing="1" bgcolor="#CCCCCC" class="searchResult"> <tbody> <tr> <td>7 hrs -20 mins</td> </tr> <tr> <td>7 hrs -20 mins</td> </tr> </tbody> </table> But both of your input times were the same, if I change one of them from <JrnyTm>400</JrnyTm> to <JrnyTm>500</JrnyTm> I get <table xmlns:xs="http://www.w3.org/2001/XMLSchema" width="98%" border="0" cellPa dding="0" cellSpacing="1" bgcolor="#CCCCCC" class="searchResult"> <tbody> <tr> <td>7 hrs -20 mins</td> </tr> <tr> <td>8 hrs 20 mins</td> </tr> </tbody> </table> showing the time is recalculated.. Your actual calculation is probably not what you want (you probably always want the minuutes to be positive) but your example doesn't show the problem that you stated in your original post. You don't want to use format-number to get a string and then number() to convert it back to a number, you probably just want something like <xsl:with-param name="hrs" select="floor(JrnyTm div 60)"/> <xsl:with-param name="mins" select="JrnyTm - floor(JrnyTm div 60) * 60"/> which gives <tr> <td>6 hrs 40 mins</td> </tr> <tr> <td>8 hrs 20 mins</td> </tr> David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Q - Value of param doesn', Ahsan Ali | Thread | Re: [xsl] Q - Value of param doesn', Ahsan Ali |
Re: [xsl] Q - Value of param doesn', Ahsan Ali | Date | Re: [xsl] Another Alternate table-r, Aron Bock |
Month |