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? –