0
我有几个样式表和模板,我想为它们添加一些行为。 比方说,这样的事情:将XSL参数传递给模板的通用方法
<xsl:template match="*" priority='10'>
<xsl:apply-templates select="." mode="someFunStuffsToDo"/>
<xsl:next-match/>
</xsl:template>
但是,正如我需要一些通用模板,我有使用参数的问题,因为我不知道所有的不同类型的PARAM的我能有。
是否有“易”的方式来表达类似的东西:
<xsl:template match="*" priority='10'>
<xsl:param select="All the params you get"/>
<xsl:apply-templates select="." mode="someFunStuffsToDo">
<xsl:with-param select="All the params you got"/>
</xsl:apply-templates>
<xsl:next-match/>
</xsl:template>
我可以基于通用PARAM其中将包括PARAMS的节点,但我需要重写我的大部分实际的想象一些解决方案模板切换不同的细节PARAMS声明一般一个...
编辑: 好吧,我想我只是发表我的问题之前刚刚找到一个解决方案: 隧道参数。 那是我的目的工作,我明白了,我的意思是,如果我只是之前和之后我的设置参数与属性隧道=“是”
<xsl:template match="*" priority='10'>
<xsl:apply-templates select="." mode="someFunStuffsToDo"/>
<xsl:next-match/>
</xsl:template>
是否行得通呢? (我还没有测试过,对我很惭愧,但我认为下一场比赛会保留当前模式)