Not entirely sure what's happening. I've managed to narrow down the template where this error is occurring

<xsl:template match="Application/Comment">
            <xsl:when test="string($ImportXML/Application/Comment)">
                <xsl:apply-templates select="$ImportXML/Application/Comment/text()"/>
                <xsl:apply-templates select="."/>

$ImportXML/Application/Comment = "test". Essentially, I'm trying to update my document so that the XPath Application/Comment is now populated with "test". It is currently a blank element with no text or value but when I run the stylesheet over the xml, I am left with that error message

Can anyone help? Would be greatly appreciated.

By the way, I am using XSL version 1.0

3 Years
Discussion Span
Last Post by Mike Askew

Your issue lies in the <xsl:otherwise>.

You are selecting the current node Application/Comment with <xsl:apply-templates select="."/> and then applying templates against it, triggering an infinite loop as this simply calls the same template over and over, eventually running out of memory causing the stack overflow you are seeing.

Tested this within Visual Studio debugging the XSL as best I could with the data provided and was able to recreate the issue.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.