我遇到了写XSL的问题。我有一个链接,代码如下:
<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()
以多种不同的方式,但仍然没有成功...例如,如果我的URL是
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
是'ū'转义的方式)有什么建议吗?谢谢。