How to fix: General entity "source" not defined and no default entity

Most Likely Cause and Fix

You've used … &source … in an attribute value where you should have used … &source ….


<example><a href=";source=cat">ppp</a>

instead of

<a href="">ppp</a>

What This Error Means

This type of error refers to an entity. An entity in this context is an encoded character or symbol that you might want to present in a web page.

Examples include &amp; to display an ampersand (&), which has a special meaning in HTML, and &copy; to display a copyright symbol (©), not commonly found on keyboards.

Entities have to be defined before they can be used. All the named entities available to you have been defined in an HTML specification.

Referring to an entity that is not defined will cause this error.

How To Fix It

An incorrectly-encoded ampersand is the most likely culprit.

The ampersand (&) has a special meaning in HTML. You can't just put an ampersand in your markup as-is without causing some confusion.

Make sure all ampersands are encoded correctly as &amp; in your markup.

A URL query string (either to be displayed in the page or in an element attribute)


<a href=";source=cat">ppp</a>

instead of

<a href="">ppp</a>

Directly in a web page


<p>Foo &amp; bar</p>

instead of

<p>Foo & bar</p>

Include a special character using a numeric entity

If you are trying to use a named entity that you thought exists but actually doesn't, use the numeric entity instead of the (non-understood) named entity.

Try using

<p>That'll be &#0163;10, please </p>

instead of

<p>That'll be &pound;10, please </p>

Discuss, Comment and Improve

Did this help you? Can this page be improved? Let us know!

comments powered by Disqus