urlEncode (text : string) : string

The method “urlEncode” changes a character string into a valid URL. In doing so, special characters are replaced with appropriate hexadecimal values.

<xsl:variable name="url">
<xsl:value-of select="c.literalUri('default', 'lang', 'de')" />
<xsl:value-of select="$url" />
<br />
<xsl:value-of select="web:urlEncode($url)" />

The output of the example looks as follows: 


The first output is a URL without the use of urlEncode. Unlike the second output, where all special characters are replaced.