3
我寫我的XSL有問題。我有下面的代碼的鏈接:URL編碼與XSLT 1.0
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat($myUrl,'&projectNumber=',$projectNumber)"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="title"/>
</xsl:attribute>
LINK
</a>
所以我需要一個變量projectNumber
傳遞給的myUrl
結束。這工作得很好,我在HTML中獲得...myUrl...&projectNumber=...projectNumber...
。
問題是,變量projectNumber
有時有一些字符必須在我的鏈接的href中轉義。我嘗試使用XSL功能str:escape-uri()
在許多不同的方式,但仍然沒有成功...
例如,如果myUrl是www.example.com/example.aspx?a=b
和projectNumber是aaaūaaa
我得到href的www.example.com/example.aspx?a=b&projectNumber=aaaūaaa
,但我需要得到www.example.com/example.aspx?a=b&projectNumber=aaa%C5%ABaaa
。 (%C5%AB
是'ū'逃跑的方式)有什麼建議嗎?謝謝。
試圖用的,而不是「編碼換URI」編碼-URI「相同的代碼,但它仍然無法正常工作兩種方式:/ –
使用嵌入的JScript試過嗎? –
不,我沒有試過,你能告訴我一個例子,我怎樣才能將projectNumber傳遞給嵌入式JScript並返回轉義的projectNumber? –