Re: href="http://www.xyz.com/abc&def" is not valid???

From: Claus Färber (list-w3c-html-validator@faerber.muc.de)
Date: Tue, Oct 05 1999


Date: 06 Oct 1999 00:00:00 +0000
From: list-w3c-html-validator@faerber.muc.de (Claus Färber)
To: www-validator@w3.org
Message-ID: <7QNlIU23cDB@faerber.muc.de>
Subject: Re: href="http://www.xyz.com/abc&def" is not valid???

Ian Jacobs <ij@w3.org> schrieb/wrote:
> Hendrik Dilling wrote:
> > The validator seems to take URL's as part of the HTML code, so I get in
> > trouble validating links which include the character "&".

The URL _is_ part of the HTML document. For more information see the FAQ  
reerences to which were already posted.

> RFC 2396 [1] defines "&" as reserved character:
>
> 2.2. Reserved Characters
>       reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
>                     "$" | ","

This reference has absolutly nothing to do with the question. It defines  
which characters are reserved within URIs for special purposes: E.g. ":"  
is used to separate protocol and URI, "@" separates user from host  
names, "/" is the hierarchy separator -- and ";" and "&" are used to  
separate parameters. Still they are valid URI characters.

But "...?xyz&abc" and "...?xyz%26abc" are different URIs: In the first  
case there are two parameters "xyz" and "abc", in the second case  
there's only one "yxz&abc".

This has ABSOLUTLY NOTHING to do with the fact that character references  
are escaped in HTML attribute values.

-- 
Claus Andre Faerber <http://www.faerber.muc.de>
PGP: ID=1024/527CADCD FP=12 20 49 F3 E1 04 9E 9E  25 56 69 A5 C6 A0 C9 DC