[xquery-talk] escape-uri() not escaping special characters

Martin Probst martin at x-hive.com
Thu Jul 7 10:42:01 PDT 2005


Hi,
I think the function fn:escape-uri() is provided for a different task.
The idea is that if you're constructing a URL within XQuery, e.g. by
appending something like your category to the URL, you can escape that
using fn:escape-uri():

let $uri :=
concat('http://example.com/foo/',fn:escape-uri($uriappendix))

So that all special characters like &, whitespace etc. are escaped in
$uriappendix. If you escape the first part the colon and slashes will be
turned into values escaped with %, so the URI will not work at all.

Regards,
Martin



More information about the talk mailing list