【发布时间】:2011-04-22 06:49:13
【问题描述】:
使用 XSLT 1.0,我试图从本质上创建一个小节点集,然后将其作为参数传递给模板,如下所示:
<xsl:call-template name="widget">
<xsl:with-param name="flags">
<items>
<item>widget.recent-posts.trim-length=100</item>
<item>widget.recent-posts.how-many=3</item>
<item>widget.recent-posts.show-excerpt</item>
</items>
</xsl:with-param>
</xsl:call-template>
我的想法是,然后在 widget 模板中我可以编写如下内容:
<xsl:value-of select="$flags/item[1]" />
显然我得到编译错误..我怎样才能实现这种事情?
【问题讨论】: