xsl-list
[Top] [All Lists]

RE: RE: problem with date:add

2006-02-23 05:39:45
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(_dot_)smith(_at_)itility(_dot_)co(_dot_)uk] 
Sent: 23 February 2006 11:15
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>