简化的例子:XSLT - 有没有一种方法,以追加到具有的<xsl:属性>添加属性?
<xsl:template name="helper">
<xsl:attribute name="myattr">first calculated value</xsl:attribute>
</xsl:template>
<xsl:template match="/>
<myelem>
<xsl:call-template name="helper" />
<xsl:attribute name="myattr">second calculated value</xsl:attribute>
</myelem>
</xsl:template>
有一些方法用于第二至追加的第二计算值,以在结果节点相同myattr
属性?
我已经看到了这是可能的,如果目标属性是在源XML使用属性值模板,但我可以引用不知何故,我刚才添加到结果节点的属性值?
在此先感谢!
好主意!还有一个问题:我可以在“helper”模板中添加更多参数,并可能在调用中使用更多的元素? –
(回答我自己的问题:)是的,可以使用更多的参数。 –