Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: An XML question - calculating time total

From: "Mauricio Grimberg" <mau@---.---.-->
To: NULL
Date: 3/2/2005 11:21:00 AM
1)About string formats in XSL: I'm happy to use XSL extensions to resolve 
this issue. Using an extension is fairly simple (you can see 
http://www.15seconds.com/issue/031105.htm and 
http://www.csharpfriends.com/Members/Main/Tutorials/get_tutorial.aspx?tutID=64 ) 
.
There is a great job done in EXSLT.org for the MVPXML group there. Using an 
extension you simply wrap the .Net string functions, like ToString(Format).
2)To perform your sum just use the sum function with an appropriate XPATH 
instruction.

"Uncle Ben" <spamfree@n...> wrote in message 
news:%23eA3AWhHFHA.3588@T......
>I would like to produce the following output based on my XML file:
>
> My Album (2005)
> Elapsed Time (hh:mm:ss): 00:07:00
>
> Song 1: title1
> Length (hh:mm:ss): 00:02:30
>
> Song 2: title2
> Length (hh:mm:ss): 00:02:15
>
> Song 3: title3
> Length (hh:mm:ss): 00:02:15
>
>
> =====
>
> <album>
>   <general>
>      <title>My Album</title>
>      <year>2005</year>
>   </general>
>
>   <content>
>      <song>
>         <songTitle>title1</songTitle>
>         <songLengthInSeconds>150</songLengthInSeconds>
>      </song>
>      <song>
>         <songTitle>title2</songTitle>
>         <songLengthInSeconds>135</songLengthInSeconds>
>      </song>
>      <song>
>         <songTitle>title3</songTitle>
>         <songLengthInSeconds>135</songLengthInSeconds>
>      </song>
>   </content>
> </album>
>
> =====
>
> I need some help in designing the XSLT file.  I'd like the
> <songLengthInSeconds> to be formatted in hh:mm:ss format.  Also, I want to
> display the elapsed time (in hh:mm:ss format) based on a total of
> <songLengthInSeconds>.  Could I perform this summation inside the XSLT?
>
> Thank you very much!
>
>
> 




transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent