Re: Parser Error?

On Mon, 14 Jun 1999, Bjoern Hoehrmann wrote:

> | > So, for example, an & _denotes_ the & character. When you
> | > have HREF="http://host.dom/foo.pl?a=1&b=2", then the URL
> | > itself is http://host.dom/foo?a=1&b=2 but it must be written
> | > slightly differently in HTML. An HTML parser or a validator
> | > still does not parse the URL according to any specific syntax.
> | > It does the same basic thing with &stuff as it does elsewhere.
> |
> | In theory. Practice can be a different thing.
> |
> | http://www.mg.co.za/mg/m&e/archive.htm
> |
> | Okay, yes, that's an ampersand in the URL and directory name, and
> | they're running Apache 1.3.4 (unix).
> 
> This is an ampersand in an url not in a href attribute, not in html et al.
> 
> | What I'd dearly like to know is why:
> |
> | http://www.mg.co.za/mg/m&e/archive.htm
> |
> | doesn't work. Yes, it's probably due to Netscape 4.5 not parsing &
> | correctly...
> 
> As a url it does not work, but in an href attribut it works in most Browser
> (except Amaya e.g.).
> 
> In html the ampersand must be encoded, not in an Url. In an Url you should
> better use %xx-encoding.

http://www.mg.co.za/mg/m%26e/archive.htm

works.

is http://host.dom/foo?a=1%26b=2

doesn't. Pick your cases carefully.

L.

<L.Wood@surrey.ac.uk>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>

Received on Monday, 14 June 1999 16:24:40 UTC