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

RE: date:add template

Subject: RE: date:add template
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 4 Mar 2005 22:19:30 -0000
exslt date add
If you're using the constructor function xs:date() and the "as" attribute on
xsl:variable, then you're using an XSLT 2.0 processor, which means you don't
need the EXSLT date library: you can get tomorrow's date simply by doing

current-date() + xdt:dayTimeDuration('P1D')

Having said that, I don't know why it's running out of memory.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Breygin, Victor [mailto:Victor.Breygin@xxxxxxxxxxxxxxx] 
> Sent: 04 March 2005 22:09
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject:  date:add template 
> 
> Hello,
> 
> can anyone suggest how to make this work?
> It seems to go into endless recursive loop and eventually 
> gets out of memory
> (regardless
> how much memory is given to JVM).  I would expect it computing the
> tomorrow's date.
> Am I missing something?
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"  
> xmlns:date="http://exslt.org/dates-and-times">
> 	
>   <xsl:import href="C:/SAXON/EXSLT/date/date.xsl" />
> 
> <xsl:template match="/">	
> 	
> 	 <xsl:variable as="xs:date" name="endDate">
> 					 <xsl:call-template 
> name="date:add">
>   					 <xsl:with-param 
> name="date-time"
> select="xs:date(date:date())" />
>   					   <xsl:with-param 
> name="duration">
>   				  			
> <xsl:call-template
> name="date:duration">
>           				    		 <xsl:with-param
> name="seconds" select="  60 * 60 * 24 " />
>         		  		  		
> </xsl:call-template>
> 
>         		  		   </xsl:with-param>  	        
> 					</xsl:call-template>
> 	 </xsl:variable>
> 	 
> 	<xsl:text>tomorrow's date is  </xsl:text> <xsl:value-of
> select="$endDate"></xsl:value-of>
> 
> </xsl:template> 
> 
> </xsl:stylesheet>
> 
> thanks in advance for your help,
> its greatly appreciated.
> 
> thanks
> victor

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.