HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: Ampersands in external URLs
Author: Xavier Roche
Date: 10/29/2004 19:16
 
> I'm using the excellent httrack

:)

> In the mirror version of the site the external links have
> been changed by httrack to the form:
> <http://www.example.com/program?arg1=val1&arg2=val2>
> Notice how the `&amp;' has changed to `&'.  This is 
invalid
> HTML according to:

Hum, this is also suggested by XHTML. I'll fix this 
bug "soon" (probably in the next subrelease)

<http://www.w3.org/TR/xhtml1/>
C.12. Using Ampersands in Attribute Values (and Elsewhere)
In both SGML and XML, the ampersand character ("&") 
declares the beginning of an entity reference (e.g., &reg; 
for the registered trademark symbol "®"). Unfortunately, 
many HTML user agents have silently ignored incorrect usage 
of the ampersand character in HTML documents - treating 
ampersands that do not look like entity references as 
literal ampersands. XML-based user agents will not tolerate 
this incorrect usage, and any document that uses an 
ampersand incorrectly will not be "valid", and consequently 
will not conform to this specification. In order to ensure 
that documents are compatible with historical HTML user 
agents and XML-based user agents, ampersands used in a 
document that are to be treated as literal characters must 
be expressed themselves as an entity reference 
(e.g. "&amp;"). For example, when the href attribute of the 
a element refers to a CGI script that takes parameters, it 
must be expressed as
<http://my.site.dom/cgi-bin/myscript.pl?class=guest&amp;name=user> rather than
as 
<http://my.site.dom/cgi-bin/myscript.pl?class=guest&name=user>.


 
Reply Create subthread


All articles

Subject Author Date
Ampersands in external URLs

10/22/2004 17:09
Re: Ampersands in external URLs

10/29/2004 19:16




7

Created with FORUM 2.0.11