W3C home > Mailing lists > Public > www-validator@w3.org > September 1999

Re: Problems with & in URIs

From: L. David Baron <dbaron@fas.harvard.edu>
Date: Sun, 19 Sep 1999 19:16:11 -0400 (EDT)
Message-Id: <199909192316.TAA25108@is02.fas.harvard.edu>
To: tcc1000@cam.ac.uk, www-validator@w3.org
On Sun, 19 Sep 1999 17:41:01 -0400 (EDT), Tim Clapp
(tcc1000@eng.cam.ac.uk) wrote:
> I get a lot of moans from the validator for URIs which contain &
> characters: these are passed as arguments to a cgi script on another
> site. The validator complains that the entity is not defined: surely
> this should only happen on the body of the html, not in a URI. See
> www.croftguesthouse.co.uk for an example. I hope is is correct and this
> is a bug in the parser. Please let me know otherwise.

This is not a bug.  Entities are allowed in attribute values.  If you
want to link to the URL:


you can do so by using the &amp; entity:

<a href="http://foo.com/search?keyword=food&amp;time=today">Today's food</a>

Every browser I've tested this on (probably something like NN 4.x, IE
5.0, and Opera 3.6) handled it correctly.  I'm not sure how far you
must go back in history to find one that doesn't.


L. David Baron    Sophomore, Harvard (Physics)    dbaron@fas.harvard.edu
Links, SatPix, CSS, etc.     <URL: http://www.fas.harvard.edu/~dbaron/ >
WSP CSS AC                      <URL: http://www.webstandards.org/css/ >
Received on Sunday, 19 September 1999 19:16:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:25 UTC