[xsl] IE / FF diferent performance doing XSLT

Subject: [xsl] IE / FF diferent performance doing XSLT
From: António Mota <amsmota@xxxxxxxxx>
Date: Thu, 8 Sep 2005 22:00:39 +0100
Hello:

I have this XSLT that takes about 2 secs on IE but on FF takes 20
secs!!! and others that take up to 5 times more in FF than IE.

Digging a little i think the cause for the 2/20 diference lies on a
recursive template my xslt is calling.

Anyone had this experince before? Anybody has some advice or help?

Heres some code, in the context of a identity transform:

                        <xsl:when test="SOME TEST">
                               <xsl:call-template name="replace"/>
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:copy>
                                        <xsl:apply-templates select="*"/>
                                </xsl:copy>
                        </xsl:otherwise>

and later on,

       <xsl:template match="Menu" mode="replace" name="replace">
                <xsl:choose>
                        <xsl:when test=" Type='REP'  and Visual='NODE' ">
                                <xsl:variable name="xmldoc"
select="I'M GETTING SOME DATA FROM ANOTHER DOC"/>
                                <xsl:if test="count($xmldoc|current())!=1">
                                        <xsl:apply-templates
select="$xmldoc" mode="replace"/>
                                </xsl:if>
                                <xsl:if test="count($xmldoc|current())=1">
                                        <xsl:copy>
                                                <Caption>WARNING:
Infinite loop on <xsl:value-of select="Name"/></Caption>
                                                <xsl:apply-templates
select="@*|node()[not(self::Caption)]"/>
                                        </xsl:copy>
                                </xsl:if>
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:copy>
                                        <xsl:apply-templates select="*"/>
                                </xsl:copy>
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>

so in english, when i found a specific node in my tree, and it's of
Type=REP, i go look at another document for nodes based on some of
it's data, and for the nodes returned, if they are REP's i want to
repeat the process, and so on and so on...

I have a escape code for situations where the returned code is itself,
so it never goes on a loop.

I've checked in the case of the 2/20 diference situation, i only
recurse once, giving a result from document() of 9 nodes, none of wich
is a REP, so it won't recurse again.

And i know it's because of recursion because if i change the "replace"
mode to a "normal" mode (that simply copies the nodes) both browsers
take aprox. the same time to do it.


I'm completly lost in here, someone can help?

Thanks a lot.


P.S. Someone knows where are the <xsl:message>'s go in IE?

Current Thread