日期:2014-05-18  浏览次数:20812 次

xsl + xml 生成html的问题
xslt模板文件中,链接地址是拼凑出来的,

<a href=<xsl:value-of select="itemSpotArea"/> class="gray"><xsl:value-of select="itemName"/></a>

这种,href后面怎么写?这里我怎么写,他都是报错。

------解决方案--------------------
你可以这样设:
<a class="gray">
<xsl:attribute name="href">
<xsl:value-of select="itemSpotArea"/>
</xsl:attribute>
<xsl:value-of select="itemName"/>
</a>