- From: Jukka K. Korpela <jkorpela@cs.tut.fi>
- Date: Mon, 17 Jan 2011 00:14:21 +0200
- To: "Greg Lauver" <GregLauver@msn.com>, <www-validator@w3.org>
Greg Lauver wrote: > Character entities in an HTML5 meta description tag: ampersand (&) is > OK. Bullet (•) and other entities generate an error: > > Validation Output: 1 Error > Line 5, Column 56: reference to undeclared general entity bull > <meta name="description" content="This & that • Something > else" /> This happens irrespective of context of use of entity references, when you use the so-called XHTML serialization of HTML5. > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> This indicates you're using XHTML serialization. In it, you should not expect any entity references to be available except for those few that are predefined in XML (such as &). See http://dev.w3.org/html5/spec/Overview.html#writing-xhtml-documents See also http://wiki.whatwg.org/wiki/HTML_vs._XHTML which contains loads of points to consider when using HTML5 as XHTML. Apparently the experimental HTML5 mode of the W3C Markup Validator - a mode that is really more like a separate program performing special checking tailored for HTML5, rather than generic SGML or XML validation - treats entity references (except the XML-defined stuff) as undefined. This is somewhat drastic but understandable. The _good_ reasons for using XHTML (in general) normally mean that the data might be processed using a generic XML processor, which should not be assumed to know anything about the predefined entities in HTML5. If you wish to keep using XHTML, you can replace the entity references by the characters themselves - after all, you are using UTF-8, so this is a matter of finding a suitable editor that lets you type any character. Alternatively, less legibly, you might replace the entity references by numeric character references like •. -- Yucca, http://www.cs.tut.fi/~jkorpela/
Received on Sunday, 16 January 2011 22:15:15 UTC