2009-12-11 66 views
0

中的XML PARAM在宣佈使用功能

<xsl:param name='suffix'>some_string</xsl:param> 

我試圖用它的值在函數調用這樣

<xsl:when test='fn:ends-with(@name, {$suffix})'> 

與以下錯誤結束:

XPST0003: XPath syntax error at char 20 on line 34 in {fn:ends-with(@name, {$}: Unexpected token "{" in path expression

在XSL的函數調用中使用參數值的正確方法是什麼?

回答

1

試試這個:

<xsl:when test='fn:ends-with(@name, $suffix)'>