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

Hendrik Dilling wrote:
> 
> Hi.
> 
> The validator seems to take URL's as part of the HTML code, so I get in
> trouble validating links which include the character "&".
> 
> Would yo be so kind and correct this "bug", or is there a good reason
> for doing this?

RFC 2396 [1] defines "&" as reserved character:

<BLOCKQUOTE>
2.2. Reserved Characters

   Many URI include components consisting of or delimited by, certain
   special characters.  These characters are called "reserved", since
   their usage within the URI component is limited to their reserved
   purpose.  If the data for a URI component would conflict with the
   reserved purpose, then the conflicting data must be escaped before
   forming the URI.

      reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                    "$" | ","

   The "reserved" syntax class above refers to those characters that are
   allowed within a URI, but which may not be allowed within a
   particular component of the generic URI syntax; they are used as
   delimiters of the components described in Section 3.
</BLOCKQUOTE>

[1] http://www.ietf.org/rfc/rfc2396.txt

-- 
Ian Jacobs (jacobs@w3.org)   http://www.w3.org/People/Jacobs
Tel/Fax:                     +1 212 684-1814
Cell:                        +1 917 450-8783

Received on Tuesday, 5 October 1999 14:58:02 UTC