2012-11-16 40 views
0

我搜索並嘗試了各種解決方案(例如,使用xsl:variable),但都沒有工作。作爲javascript函數參數的XSL

這是我的情況。這工作,但我想通過xsl_value-作爲參數,以提醒():

<a href="#" onclick="alert('text')"><xsl:value-of select="@naziv" /></a> 

所以這會是這樣的

<a href="#" onclick="alert('{<xsl:value-of select="@naziv" />}')"><xsl:value-of select="@naziv" /></a> 

回答

3

使用屬性值模板即

<a href="#" onclick="alert('{@naziv}');"><xsl:value-of select="@naziv"/></a> 
+0

謝謝,更優雅的解決方案! –