You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Mikko Rahkonen <ra...@st.jyu.fi> on 2000/12/09 19:01:37 UTC

StackOverFlowError with Xalan-J 2.0.D01

Hi!

I keep getting StackOverFlowError with Xalan-J 2.0.D01 when I try to use
the following do-replace template:

<xsl:template name="do-replace">
   <xsl:param name="text"/>
   <xsl:param name="replace"/>
   <xsl:param name="by"/>
   <xsl:choose>	
   <xsl:when test="contains($text,$replace)">
      <xsl:value-of select="substring-before($text, $replace)"/>
      <xsl:value-of select="$by"/>
      <xsl:call-template name="do-replace">
         <xsl:with-param name="text"
              select="substring-after($text,$replace)"/>
	 <xsl:with-param name="replace" select="$replace"/>
         <xsl:with-param name="by" select="$by"/>
      </xsl:call-template>
   </xsl:when>
   <xsl:otherwise>
      <xsl:value-of select="$text"/>
   </xsl:otherwise>
   </xsl:choose>
</xsl:template>

Now when I call the template 

<xsl:call-template name="do-replace">
  <xsl:with-param name="text" select="TEXT_TO_BE_REPLACED"/>
  <xsl:with-param name="replace" select="REPLACE_STRING"/>
  <xsl:with-param name="by" select="REPLACE_BY_STRING"/>
</xsl:call-template>

I get java.lang.StackOverflowError. What I'm doing wrong?

-- 
Mikko Rahkonen <ra...@st.jyu.fi>