Please slove the below error.

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
basheer
Rank 0 - Newcomer
Posts: 3
Joined: Tue May 30, 2006 9:53 pm

Please slove the below error.

Post by basheer »

How to avoid from geeting this error message. Found an ampersand '&' but could not find a following semicolon for a properly formed character reference. If you want to actually display an ampersand, such as in "Recreation & Sports", then use the character entity reference "&" as in "Recreation & Sports" (see comment).
User avatar
Lou
Rank V - Professional
Posts: 297
Joined: Fri Jul 29, 2005 5:55 pm
Location: CO

Re: Please slove the below error.

Post by Lou »

basheer wrote:How to avoid from geeting this error message. Found an ampersand '&' but could not find a following semicolon for a properly formed character reference. If you want to actually display an ampersand, such as in "Recreation & Sports", then use the character entity reference "&" as in "Recreation & Sports" (see comment).
I guess I don't understand your question. The suggestion how to avoid the error by replacing an "&" in your text with "&amp" seems straight forward. "<" and ">" also must be handled with care as noted in your other posting.

If you would provide an example of the html that is causing the problem we could be of more help.
MaryLouW
Rank 0 - Newcomer
Posts: 4
Joined: Sat May 13, 2006 9:45 pm

Post by MaryLouW »

I have the same problem. For example, if I put the following in my text:

Henry & Jane are friends.

I will get that error message. I would like to avoid it without having to go back and putting in html code in the middle of a sentence.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Post by Albert Wiersch »

MaryLouW wrote:I have the same problem. For example, if I put the following in my text:

Henry & Jane are friends.

I will get that error message. I would like to avoid it without having to go back and putting in html code in the middle of a sentence.
Hello,

If you use the ampersand in text in an HTML document, then it should be escaped to avoid confusion with the beginning of a character reference. The ampersand is an escape character in HTML. I do not know of a way to avoid this (not use &) and still be correct. Example:

Henry & Jane are friends.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
MikeGale
Rank VI - Professional
Posts: 726
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Post by MikeGale »

This might be the commonest error made in web pages.

You can get away with believing you're writing normal text, most of the time, but this shows that it's not.

I don't think there is a work around. (However pages that get this right do indicate web authors who know what they're doing.)