RE: [FO]: OB01 escape-uri

On Wed, 10 Dec 2003, Ashok Malhotra wrote:

> If $escape-reserved is true, all characters are escaped other than the
> lower case letters a-z, the upper case letters A-Z, the digits 0-9,
> the PERCENT SIGN "%" and the NUMBER SIGN "#" characters and the
> characters referred to in [RFC 2396] as "marks": specifically,
> HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", EXCLAMATION MARK
> "!", TILDE "~", ASTERISK "*", APOSTROPHE "'", LEFT PARENTHESIS "(",
> and RIGHT PARENTHESIS ")".
>
> If $escape-reserved is false, all characters are escaped other than
> the lower case letters a-z, the upper case letters A-Z, the digits
> 0-9, the PERCENT SIGN "%" and the NUMBER SIGN "#" characters and the
> characters referred to in [RFC 2396] as "marks":  HYPHEN-MINUS ("-"),
> LOW LINE ("_"), FULL STOP ".", EXCLAMATION MARK "!", TILDE "~",
> ASTERISK "*", APOSTROPHE "'", LEFT PARENTHESIS "(", and RIGHT
> PARENTHESIS ")".
>
> In addition, the characters referred to in [RFC 2396]
[...]

I wonder if it is really necessary to repeat the whole list of characters
that are never escaped (regardless of $escape-reserved). As a reader I
would assume a subtle difference between these paragraphs, but there
isn't. (aside from the "specifically" ;-)

Wouldn't it be more readable to specify this list only once?

> 7.4.10.1 Examples
> * fn:escape-uri ("http://www.example.com/Weather/CA/Los%20Angeles#ocean",
>                  true()) returns 
> "http%3A%2F%2Fwww.example.com%2F00%2FWeather%2FCA%2FLos%20Angeles#ocean"

Almost. The argument URI should read
"http://www.example.com/00/Weather/CA/Los%20Angeles#ocean"
                       ^^^
(like in the second example, note the missing "/00")

The third example has been already commented by Michael Kay.

Best regards,
Oliver Becker

Received on Thursday, 11 December 2003 10:10:40 UTC