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

Re: MSXLS equivalent for xs:date('2010-11-20')+ xs:ye

Subject: Re: MSXLS equivalent for xs:date('2010-11-20')+ xs:yearMonthDuration( concat( 'P',$x,'D'))
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 28 Sep 2010 17:29:10 +0200
Re:  MSXLS equivalent for xs:date('2010-11-20')+  xs:ye
Bartolomeo Nicolotti wrote:

I've to maintain an XSLT 1.0 stylesheet on .net framework.

I've found that on this version

Cannot find the script or external object that implements prefix
'http://www.w3.org/2001/XMLSchema'.

so no xs:date and xs:yearMontDuration

Does anybody know an equivalent for

xs:date('2010-11-20')+ xs:yearMonthDuration( concat( 'P',$x,'D'))


I've to add $x days to a date. Googled, but hard to find.

Microsoft's XslCompiledTransform is an XSLT 1.0 processor and XSLT/XPath 1.0 do not know any date type, all there is is number, string, boolean, node-set, result tree fragment.
If you want a date type and operations on that then use XSLT 2.0, it is available for .NET with Saxon 9 and with XQSharp.
Or if you insist on using XslCompiledTransform then look into extension function and objects (http://msdn.microsoft.com/en-us/library/6datxzsd.aspx) to leverage the .NET class library types for date parsing and date manipulation.



--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

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.