A bug, a bug, and a very annoying one!
Richard Frith-Macdonald
richard at brainstorm.co.uk
Tue Nov 12 01:22:59 PST 1996
Mark Doyle wrote:
> >The ampersand ("&") character is special in HTML. Whenever you want a
> >literal ampersand, you really should use "&", e.g.
>
> >> <A HREF="<http://ding/cgi-bin/rman.pl?topic=apropos&section=1"> ...
>
stuff omitted
>
> Well, now it has come time for one of our programmers to implement
> some URL's of the above style. I started to point out the problems
> with the ampersands, which developed in to a bit of an argument, so I
> went off an read the URL RFC:
>
> <http://www.w3.org/pub/WWW/Addressing/rfc1738.txt
>
> which says:
excerpt from rfc omitted
>
> As you can see, a search is begun with a ? and it may use &'s as a
> reserved character (typically to designate fields of key and value
> pairs). This is precisely the case for the kinds of URL's we are
> talking about as in the exxample above. So, isn't it really an OmniWeb
> bug that it is trying to interpret the & as something other than a
> reserved character in a search string? Is there some other standard I
> should be looking at?
>
There is a simple misunderstanding here -
Yes the ampersand is perfectly legal in a URL...
but we are talking about a URL which is in an HTML document as the value of
one of the parameters of an HTML element.
The HTML specification says that entities in element parameter values
(sequences of characters beginning with an ampersand and ending with a
semicolon) should be replaced with the entity values.
This substitution happens BEFORE the value is used as a URL, so when you put
something like -
<A HREF="http://ding/cgi-bin/rman.pl?topic=apropos&section=1">
in your HTML document, the URL that you are specifying is -
http://ding/cgi-bin/rman.pl?topic=apropos§ion=1
The behaviour of OmniWeb is quite correct (unless you have 'Netscape
compatible nonterminated entities' turned on - in which case it emulates a
Netscape bug).
PS. I have no connection with Omni, but I have written a web server and an
HTML parser, and have spent a LOT of time reading the relevant RFCs.
More information about the OmniWeb-l
mailing list