escape-uri($uri as xs:string?, $escape-reserved as xs:boolean) xs:string
This function applies the URI escaping rules defined in section 2 of [RFC 2396] as amended by [RFC 2732], with one exception, to the string supplied as $uri, which typically represents all or part of a URI. The effect of the function is to escape a set of identified characters in the string. Each such character is replaced in the string by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. $escape-reserved indicates whether to escape reserved characters.
$uri
The URI
$escape-reserved
The escaped-reserved
Returns the identified characters in $uri encoded with escape sequences