I need to URL Encode a string in XSLT but the function:
fn:encode-for-uri
breaks the script. I checked it out online and apparently it's part of the namespace
http://www.w3.org/2005/xpath-functions
So i added the following line to the top of my XSLT file to no avail.
xmlns:fn="http://www.w3.org/2005/xpath-functions"
Any ideas? I stepped through it in Visual Studio and I got the exception:
Cannot find a script or an extension object associated with namespace 'http://www.w3.org/2005/xpath-functions'.
Any ideas?
-Ev
Visual Studio uses a .NET XSLT processor -- that is XSLT 1.0 processor.
The function encode-for-uri() is a standard function only in XPath 2.0 / XQuery . XSLT 1.0 processors only use XPath 1.0 and the encode-for-uri()
function is not implemented and available.
In order to use this function you need an XSLT 2.0 processor, such as Saxon.NET or XQSharp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With