[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Adding duration to date
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|