Adnan Adnan - 1 year ago 196
HTML Question

The reference to entity "foo" must end with the ';' delimiter

I have Google checkout sandbox generated HTML code which works fine in HTML page. When I put the same code in XHTML page, it throws the below exception:

the reference to entity "w" must end with the ';' delimiter

It's referring the request parameter
in the URL in the below

<input type="image" name="Google Checkout" alt="Fast checkout through Google"
height="46" width="180" />

How is this caused and how can I solve it?

Answer Source

The ampersand & is a special character in HTML and XML. If you want to use it as a normal chararacter, you have to encode it correctly. Write &amp; instead of &:


& denotes the start of an encoded entity, such as &lt; for <, or &amp; for &. Entities are always terminated by an ;, thus if the ; is missing you get the error message.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download