1

再帰テンプレート内で再帰テンプレートを実行しようとしていますが、実行できません

<xsl:template match="feed">
    <xsl:call-template name="recursiveLoop">
        <!-- for loop pass in params -->
    </xsl:call-template>

</xsl:template>

<xsl:template name="recursiveLoop">     
    <xsl:if test="$count &lt; 12">
        <!-- loop through 12 times -->
        <!-- sort months and get data -->

        <xsl:choose>
            <xsl:when test="($realCurrentMonth + $count = $outboundMonthFromDoc) or ($tempMonthToDisplay = $outboundMonthFromDoc)">
                <p><xsl:text>price is available</xsl:text></p>                              
            </xsl:when>
            <xsl:otherwise>             
                <xsl:call-template name="loopToFindCorrectMonth">
                    <xsl:with-param name="count2" select="0"/>                  
                </xsl:call-template>                    
                <xsl:template name="loopToFindCorrectMonth">
                    <xsl:param name="count2"/>
                    <xsl:if test="$count2 &lt; 12">
                        <xsl:text>hello</xsl:text>
                        <xsl:call-template name="loopToFindCorrectMonth">
                            <xsl:with-param name="count2" select="$count2 + 1"/>            
                        </xsl:call-template>
                    </xsl:if>           
                </xsl:template>                 
            </xsl:otherwise>
        </xsl:choose>   

        <xsl:call-template name="recursiveLoop">
            <!-- pass params in again -->
        </xsl:call-template>
    </xsl:if>
</xsl:template>

最初のループは「recursiveLoop」で、2 番目のループは「loopToFindCorrectMonth」です。ただし、2 番目のループは機能しません。ループを削除して、以下のような単純な出力ステートメントに置き換えると、機能します。そのため、2 番目のループに問題があり、それが何であるかわかりません。

<xsl:choose>
    <xsl:when test="($realCurrentMonth + $count = $outboundMonthFromDoc) or ($tempMonthToDisplay = $outboundMonthFromDoc)">
        <p><xsl:text>price is available</xsl:text></p>                              
    </xsl:when>
    <xsl:otherwise>             
        <p><xsl:text>Loop has been removed</xsl:text></p>   
    </xsl:otherwise>
</xsl:choose>   
4

0 に答える 0