Re: Missing blank in a text node after validation using JTIDY

In <20020302073947.62408.qmail@web9502.mail.yahoo.com>, Khurram Majeed <khurri_7@yahoo.com> writes:
>  I m also having similar type of problem. Consider the html below
> <html>
> <body> ...
> <p>&nbsp;</p>
> </body>
> </html>
> When this xml is opened in Internet Explorer 5.0. The following error comes.
> error: cannot identify &nbsp; between <p>.
> Does anyone know what is the problem..

If the file is served with a MIME type text/xml (usually with an extension .xml)
the problem is that &nbsp; is an undefined entity.

The same file will work okay with a MIME type text/html (with an extension .htm
or .html).

XHTML is XML plus HTML entities, and browsers render XHTML as HTML.

XML does not know about HTML entities so &nbsp; is an undefined entity. If you 
want to use the file as XML, you can define the entity, like this:

<!DOCTYPE html
[
<!ENTITY nbsp "&#160;">
]>

and Internet Explorer should render the page okay as XML.

-- 
Klaus Johannes Rusch
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/

Received on Sunday, 3 March 2002 08:52:32 UTC