"Colin" == Colin Paul Adams
<colin(_at_)colina(_dot_)demon(_dot_)co(_dot_)uk> writes:
"Michael" == Michael Kay <mhk(_at_)mhk(_dot_)me(_dot_)uk> writes:
Michael> <xsl:variable name="first-of-previous-month"
Michael> select="xs:date('0000-01-01') + ($previous-month *
Michael> $one-month)" as="xs:date"/>
Colin> Well, Saxon 8.0 doesn't allow this (quite right too - there
Colin> never was a year zero!). I tried substituting -0001-01-01,
Colin> which saxon doesn't complain of, but
Colin> date='{first-of-previous-month}'" is coming out as date=''.
ah well, two typos involved there.
The second one was mine - missed out the $.
The first was yours - you had xs: instead of xdt: for a
yearMonthDuration.
Having corrected that, I end up with first of June rather than 1st of
May, so I will go over the logic, but at least you've shown me how to
work with dates - thanks.
--
Colin Paul Adams
Preston Lancashire