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

RE: RE: problem with date:add

Subject: RE: RE: problem with date:add
From: "Andrew Smith" <andrew.smith@xxxxxxxxxxxxx>
Date: Thu, 23 Feb 2006 12:39:45 -0000
xsl date add month
Nevermind :-)

I put in a load of <xsl:value-of /> so I could see what was getting
assigned to each variable and saw that $month-days and $days-in-month
wasn't being set correctly, so I removed

<xsl:variable name="month-days"
select="document('')/*/date:month-lengths/date:month"/>

and replaced

<xsl:variable name="days-in-month">
	<xsl:choose>
		<xsl:when test="$month = 2 and $leap">
			<xsl:value-of
select="$month-days[number($month)] + 1"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of
select="$month-days[number($month)]"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

With

<xsl:variable name="days-in-month">
	<xsl:choose>
		<xsl:when test="$month = 1 or
					$month = 3 or
					$month = 5 or
					$month = 7 or
					$month = 8 or
					$month = 10 or
					$month = 12">31</xsl:when>
		<xsl:when test="$month = 2 and $leap">29</xsl:when>
		<xsl:when test="$month = 2">28</xsl:when>
		<xsl:otherwise>30</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

And now all is working fine :-D (I changed the $days-in-new-month as
well with something similar).

Thanks for the help before
Andy

-----Original Message-----
From: Andrew Smith [mailto:andrew.smith@xxxxxxxxxxxxx]
Sent: 23 February 2006 11:15
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  RE: problem with date:add

Hello again,

I was going to try and see where the problem that I'm seeing with this
template lies
(http://www.biglist.com/lists/xsl-list/archives/200602/msg00371.html)
and was wondering if there's any advice you could give me about how to
narrow down where the problem exactly is.

Thanks
Andy

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.