IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: warstar
About
User Name: warstar
Forum Rank: Newbie
Real Name:
Location NL
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Thursday, August 6, 2009
Last Visit: Friday, August 7, 2009 7:41:50 AM
Number of Posts: 4
[0.02% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: AltovaXml: Strange Behavior
Posted: Friday, August 7, 2009 7:41:44 AM
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)
Topic: AltovaXml: Strange Behavior
Posted: Thursday, August 6, 2009 2:25:29 PM
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
Topic: AltovaXml: Atomization of extension object is not supported.
Posted: Thursday, August 6, 2009 1:24:54 PM
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.
Topic: AltovaXml: Atomization of extension object is not supported.
Posted: Thursday, August 6, 2009 1:01:31 PM
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

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.