This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

tough problem: infinit loop caused by XSL recusive call


Hi,

1. I try to transform a XML file to a text file by using transform class of
xalan 2.0.
2. I call the following template with countLoop select="14" that cause the
infinite loop and stack overflow,
however if I set select="8" it works fine.

3. Does anyone know how to the reason? How to fix it? Is there any
properties file which define the default stack size for xalan 2.0?

Thank you in advance!

DI



	<xsl:call-template name="data-field-loop">
			<xsl:with-param name="count" select="1"/>
			<xsl:with-param name="countLoop" select="14"/>
			<xsl:with-param name="MessageType" select="concat($MessageType,
'_DATA-')"/>
     	    		<xsl:with-param name="ScreenNo" select="$ScreenNo" />
       	      <xsl:with-param name="FieldSize" select="20" />
    	</xsl:call-template>



    <xsl:template name="data-field-loop">
	    <xsl:param name="count"/>
	    <xsl:param name="countLoop"/>
 	    <xsl:param name="MessageType"/>
	    <xsl:param name="ScreenNo"/>
	    <xsl:param name="FieldSize"/>
        <xsl:variable name="MappingField" select="concat($MessageType,
$count,'-', $ScreenNo )" />
	    <xsl:if test="$count &lt;=  $countLoop">
             <xsl:variable name="maint" select="key('key-name',
concat(generate-id(), ':', $MappingField))" />
             <xsl:call-template name="format-string">
                    <xsl:with-param name="value"
select="$maint/@newFieldValue"/>
                    <xsl:with-param name="size" select="$FieldSize"/>
             </xsl:call-template>

		    <xsl:call-template name="data-field-loop">
			    <xsl:with-param name="count" select="$count + 1"/>
  			    <xsl:with-param name="countLoop" select="$countLoop"/>
			    <xsl:with-param name="MessageType" select="$MessageType"/>
        	    <xsl:with-param name="ScreenNo" select="$ScreenNo" />
       	        <xsl:with-param name="FieldSize" select="$FieldSize" />
	        </xsl:call-template>
	    </xsl:if>
    </xsl:template>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]