# fn:escape-html-uri - XPath XQuery Reference

Escapes a URI in the same way that HTML user agents handle attribute values expected to
            contain URIs.deterministiccontext-independentfocus-independentIf $uri is the empty sequence, the function returns the zero-length
            string.Otherwise, the function escapes all characters except
            printable characters of the US-ASCII coded character set, specifically the codepoints between 32 and 126 (decimal) inclusive. Each
            character in $uri to be escaped is replaced 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. This function must always generate hexadecimal values using the upper-case
            letters A-F.fn:escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean")"http://www.example.com/00/Weather/CA/Los Angeles#ocean"fn:escape-html-uri("javascript:if (navigator.browserLanguage == 'fr') window.open('http://www.example.com/~bébé');")"javascript:if (navigator.browserLanguage == 'fr') window.open('http://www.example.com/~b%C3%A9b%C3%A9');"The behavior of this function corresponds to the recommended handling of non-ASCII
            characters in URI attribute values as described in  Appendix
            B.2.1.