PDA

View Full Version : XSLT encoding string as URI


androsynth
11th May 10, 07:42 PM
Is there a way to encode a string to be used as a URI in XSLT 1.0? I'm using XSLT 1.0 so I can't use XPath 2.0 encode-for-uri function.

I'm trying to generate an href attribute using the following code:

<a>
<xsl:attribute name="href">
##root##/Search.aspx?SearchTerm=<xsl:value-of select="DisplayText" />
</xsl:attribute>
</a>


Some of the terms have spaces and ampersands, so I need those to be escaped.