W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2002

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

From: Klaus Johannes Rusch <KlausRusch@atmedia.net>
Date: Sun, 3 Mar 2002 14:07:57 CET
Message-Id: <200203031352.IAA13413@tux.w3.org>
To: Khurram Majeed <khurri_7@yahoo.com>
Cc: html-tidy@w3.org
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
Received on Sunday, 3 March 2002 08:52:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:51 UTC