【发布时间】:2009-05-09 21:20:30
【问题描述】:
我有一个项目列表,我想为每个项目设置一个 url。
列表:
<root>
<tags>
<tag>open source</tag>
<tag>open</tag>
<tag>advertisement</tag>
<tag>ad</tag>
</tags>
</root>
XSLT:
<xsl:template match="*">
<div class="tags">
<xsl:for-each select="/post/tags/tag">
<a href="#">
<xsl:value-of select="//tag"/>
</a>
</xsl:for-each>
</div>
</xsl:template>
输出:
<div class="tags">
<a href="#">open source</a>
<a href="#">open source</a>
<a href="#">open source</a>
<a href="#">open source</a>
</div>
我做错了什么?
【问题讨论】: