Rank: Newbie
Joined: 8/6/2009 Posts: 4 Location: NL
|
Hi everyone,
I'm using the AltovaXML 2009 Sp1 Component to transform some xml files using XSLT 2.0. The only problem is then i need to (for example) add a year to a date using the c# System.DateTime object and this is resulting in a Exception saying 'Atomization of extension object is not supported.'.
Is there any one who has had this problem before and knows how to fix it?
Thanks for any help!
Cheers, Warnar
P.S. For a fully working/failing example of this problem please download the following file: http://download.lijnco.nl/AltovaHelp.zipFile Attachment(s):
AltovaHelp.zip (9kb) downloaded 284 time(s).
|
Rank: Newbie
Joined: 8/6/2009 Posts: 4 Location: NL
|
Well this is just a example. I was trying to get it down to a bare minimum and since the online help always used System.DateTime I just used it.
Also the i tryed using a xsl:variable for it has the same effect. I think the problem is that the engine just won't handle variables that are unknown to it so maybe that is my mistake.
P.S. strange i think by mistake i edited or remove your post vlad sorry.
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
I know the reason of this error message: only string, boolean, integer, float, double and decimal .NET variables can be converted to XML automatically. In all other cases you will have to do this manually.
For example, instead of your original code, which returns System.DateTime value:
<xsl:value-of select="date:AddYears($currentdate,1)" xmlns:date="clitype:System.DateTime" />
you will need to use:
<xsl:value-of select="date:ToString(date:AddYears($currentdate,1))" xmlns:date="clitype:System.DateTime" />
|