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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.