Re: Problems with Validation

by "Caryl Milton" <tippybird(at)earthlink.net>

 Date:  Sun, 15 Sep 2002 18:06:07 -0400
 To:  <hwg-basics(at)hwg.org>,
"Andrew McFarland" <aamcf(at)aamcf.co.uk>
 References:  ntlworld
  todo: View Thread, Original
Hi Andrew,

Thanks so much for explaining.  Revising to the '&amp; ' fixed the problem
and the page now validates.  I'll have to save your letter for future
reference.  These days my brain is more like a sieve!

Caryl
----- Original Message -----
From: "Andrew McFarland" <aamcf(at)aamcf.co.uk>
To: <hwg-basics(at)hwg.org>
Cc: "Caryl A. Milton" <tippybird(at)earthlink.net>
Sent: Sunday, September 15, 2002 3:52 PM
Subject: Re: Problems with Validation


> At 15:06 15/09/02 -0400, Caryl Milton wrote:
> >   ... cal.com/cat_disp.asp?SUB_CAT_NBR=0&CAT_NBR=7&NAV=6">
> >                                          ^Error: unknown entity
"CAT_NBR"
>
> Try
>
> SUB_CAT_NBR=0&CAT_NBR=7&amp;NAV=6
>
> >I have tried doing a double ampersand sign in each place, but that causes
an
> >error message when you try to click on and visit that site.
>
> When an & appears in an XHTML document, it indicates the start of an
> entity. If you don't mean it to be an entity, you must escape it as &amp;.
>
> Every time you have a `&' in an (X)HTML document you must escape it with
> &amp;, even if it is in an attribute value.[1] Browsers are very lax about
> interpreting this correctly, so you almost never encounter this problem in
> real life, but you do encounter it when validating.
>
> As an alternative, it is valid to use ; as a separator in a URL instead of
> the `&'.
>
> SUB_CAT_NBR=0&CAT_NBR=7;NAV=6
>
> This avoids the problem, and any well written CGI script should cope with
it.
>
> Andrew
>
> --
> http://aamcf.co.uk/
>
> [1] Well, not quite _every_ time - but this is basics, so I won't go into
> details. It never harms to escape an `&' when you mean it to be a literal
> `&' though.
>

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA