| warstar |
| Newbie |
|
| NL |
|
|
| None Specified |
|
| Thursday, August 6, 2009 |
| Friday, August 7, 2009 7:41:50 AM |
4 [0.02% of all post / 0.00 posts per day] |
|
Hi vlad,
What i mean is that looking at the xslt i would expect that every time the "<xsl:template match="node">" is run a new instance of the hashtable would be created. It seems that i only creates the instance once and that is why every time after finishing the template i need to Clear the hashtable.
This seems illogical to me or do you know if this is excepted behaviour?
(it also seems if i use a "<xsl:element use-attribute-sets" in some cases the information within the "<xsl:attribute-set" get's chached maybe this is the same problem)
|
Hi all,
I'm trying to add a item to a HashTable (using xml and xslt 2.0 and the .net extension). The only problem is that i get errors like "CSharp execution error - 'Error: Exception has been thrown by the target of an invocation.' - hashtable:Add". After some research i found out that if i added a clear call to the variable containing the hash there where no errors any more.
Is there any one who known why this is?
My Xslt looks like:
Code: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:hashtable="clitype:System.Collections.Hashtable">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:variable name="languageCode" select="'lang'" /> <xsl:template match="/"> <xsl:for-each select="nodes/node"> <xsl:apply-templates select="."></xsl:apply-templates> </xsl:for-each> </xsl:template>
<xsl:template match="node"> <xsl:variable name="x" select="'a'" />
<xsl:variable name="itemAttributes" select="hashtable:new()"/> <xsl:value-of select="hashtable:Add( $itemAttributes, 'id', $x )" /> <xsl:value-of select="hashtable:get_Item($itemAttributes, 'id')" /> <!-- need the following line to get to errors --> <xsl:value-of select="hashtable:Clear($itemAttributes)" /> </xsl:template>
</xsl:stylesheet>
My Xml looks like:
Code: <?xml version="1.0" encoding="utf-8" ?> <nodes> <node id="id"></node> <node id="id"></node> </nodes>
Cheers, Warnar
|
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.
|
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.zip
|
|