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

Re: Q - Value of param doesn't change ! [solved]

Subject: Re: Q - Value of param doesn't change ! [solved]
From: Ahsan Ali <doubleletter@xxxxxxxxx>
Date: Tue, 31 May 2005 17:34:01 +0400
q value table
Ah... you're right.. I should've simply used the floor function
instead of the format-number... I guess that's what was causing the
problem.

You see, the relevance to my earlier question is that for the
remaining elements (which I excluded since it was a huge xml file), it
was giving me 7 hrs -20 mins for _every_ element !

Anyways.. everything's fine now !

Thank you !

Best Regards, Ahsan

On 5/31/05, David Carlisle <davidc@xxxxxxxxx> wrote:
>
> 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

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.