How to make urlencode in XSLT?

How can I urlencode url parameter in XSLT?

There is a rawurlencode function in php that does what I want, urlencode according to RFC 3986.

+5
source share
2 answers

XPath 2.0 (and therefore XSLT 2.0) has a function encode-for-uri. I do not know how to do this in simple XPath 1.0 / XSLT 1.0 without using extension functions.

+6
source

You can also use EXSLT str:encode-uri(., 'true', 'UTF-8')in the namespacestr=http://exslt.org/strings

Most popular XSLT 1.0 processors support EXSLT firmly.

+2
source

All Articles