W3C home > Mailing lists > Public > public-html-comments@w3.org > September 2011

Re: HTML5 DOCTYPE and ENTITY declarations

From: Simon Pieters <simonp@opera.com>
Date: Fri, 02 Sep 2011 09:11:30 +0200
To: public-html-comments@w3.org, "John Boyer" <boyerj@ca.ibm.com>
Message-ID: <op.v0559hd2idj3kv@simon-pieterss-macbook.local>
On Fri, 02 Sep 2011 01:03:08 +0200, John Boyer <boyerj@ca.ibm.com> wrote:

> Dear Working Group,
> In Section 8.1.1 of [1], the allowable DOCTYPE declarations for HTML5 are
> given.  There is a  highly recommended shortest version as well as some
> legacy and obsolete alternatives.  However, none of the alternatives seem
> to allow an author to define entities to be used within the document.  Is
> this intentional or an oversight?
> [1] http://www.w3.org/TR/html5/syntax.html#the-doctype

It is intentional. Note that this section only applies to text/html  

> As an example, it seems that an internal dtd subset that looks like this
> should be admissible:
> <!DOCTYPE html [
>   <!ENTITY ent "Big mobile tree">
> ]>
> Which would then allow &ent; to be used in the HTML content.

The HTML parser does not support this.

> Particularly for the XML syntax variant served out under application/xml
> or application/xhtml+xml, it seems it would be challenging to turn off  
> the
> ability to define and use entities as the mechanism is built into the
> underlying XML parser.

It is allowed in XML (see the section "The XHTML syntax").

> However, I am asking specifically about whether
> the above declaration is also allowed in non-XML content served as
> text/html?


Simon Pieters
Opera Software
Received on Friday, 2 September 2011 07:12:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:27 UTC