URL fails in W3C HTML/XHTML Validation

url, validation, w3c, xhtml

Solution

You'd have to encode the ampersand (`&`) in URLs with `&`.

So your URL should look like:

`http://maps.google.co.uk/maps?q=N+Z&hl=en&hnear=ABC+N4+1,+Jamaica&t=m&z=1`

See info in HTML 4.01, for example. Also there is web tool which checks for ambiguous ampersands: http://mothereff.in/ampersands

Problem

I use the URL below in my web page in href tag and unfortunatelly whole link fails in W3C HTML/XHTML Validation. How do I solve this problem? ``` http://maps.google.co.uk/maps?q=N+Z&hl=en&hnear=ABC+N4+1,+Jamaica&t=m&z=16 ``` My page includes: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> . . . ```

Original source