Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Using XSL to calculate time (t = hh:mi + mi)

From: kebabkongen@-------.---
To: NULL
Date: 12/1/2006 6:07:00 AM

I'm not sure what XSLT parser we have here. Any easy way to figure this
out?
Its hard to find the administrator of the server here, and my guess is
that if I find him, he does not have this information at the top of his
head.

Is the XSLT parser significant for this type of task?

I have implemented a preliminary solution to this, though, using string
parsing anf number(), substing(), floor(), div and mod functions in the
XSL statement.

For special interested, the time for next program became:

<xsl:choose>
      	<xsl:when test =
"floor((number(substring(nr/st,4,2))+number(nr/ln)) div
60)+number(substring(nr/st,1,2)) &gt; 23" >
		<xsl:value-of
select="floor((number(substring(nr/st,4,2))+number(nr/ln)) div
60)+number(substring(nr/st,1,2)) mod 24"/>
	</xsl:when>
	<xsl:otherwise >
		<xsl:value-of
select="floor((number(substring(nr/st,4,2))+number(nr/ln)) div
60)+number(substring(nr/st,1,2))"/>
	</xsl:otherwise>
      </xsl:choose>:<xsl:choose><xsl:when test =
"((number(substring(nr/st,4,2))+number(nr/ln)) mod 60) &lt;
10">0<xsl:value-of select="(number(substring(nr/st,4,2))+number(nr/ln))
mod 60"/>
		</xsl:when>
		<xsl:otherwise >
			<xsl:value-of select="(number(substring(nr/st,4,2))+number(nr/ln))
mod 60"/>
		</xsl:otherwise>
	</xsl:choose>

Thanks for help!

-Per Magnus

fedro wrote:
> Martin Honnen schrieb:
>
> > kebabkongen@h... wrote:
>
> > XSLT/XPath 1.0 have basic string parsing functions which allow you to
>
>
> that sounds not like a job xslt, because the string functions (i.e.
> substring-after ect...) are TOO basic.
> 
> Other question: which XSLT-Parser ?



transparent
Print
Mail
Like It
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