1
所以我给了一些东西来解决,并且我对XSLT的了解有限。我基本上想从我运行的模板中保留一个变量。模板中的XSLT返回变量
<xsl:template name="repeatable">
<xsl:param name="index" select="1" />
<xsl:param name="total" select="10" />
<xsl:if test="not($index = $total)">
<xsl:call-template name="repeatable">
<xsl:with-param name="index" select="$index + 1" />
</xsl:call-template>
</xsl:if>
</xsl:template>
以上是我想从中返回变量“$ total”的模板。下面的模板是我称之为上述模板的模板。
<xsl:template match="randomtemplate">
<xsl:call-template name="repeatable" \>
</xsl:template>
所以基本上,我只想让“总”变量返回给我或以某种方式从randomtemplate访问。
干杯
恐怕这没有任何意义。 $ total参数的值是10.它被硬编码到样式表中,并且它不会改变,除非* you *改变它。 – 2014-12-02 05:23:39