[Home] [By Thread] [By Date] [Recent Entries]
tom tom wrote:
I wish to add a duration to a date, something along the lines of: You are on the right track. Make sure you spell the yearMonthDuration correctly (there are no days in a yearMonthDuration constructor) and do not use the xdt namespace anymore (http://www.w3.org/2004/10/xpath-datatypes), because it has been superseded by the namespace of XMLSchema (http://www.w3.org/2001/XMLSchema). Commonly the 'xs' prefix is used, like with XML Schema datatypes. The rest is simple: just use normal arithmetic and you are done: <xsl:sequence select="current-date() + xs:yearMonthDuration('P2Y1M')" as="xs:date" /> will add two years and one month to today. Cheers, -- Abel Braaksma
|

Cart



