[Bug 20993] XHTML5 syntax should require valid DOCTYPE declaration (<!DOCTYPE root> should match root element)

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20993

Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |xn--mlform-iua@xn--mlform-i
                   |                            |ua.no
         Resolution|WONTFIX                     |---

--- Comment #2 from Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> ---
(In reply to comment #1)
Regarding XML 1.0 validity: XHTML5 doesn’t come with a DTD. Thus we base
XHTML5’s conformance rules on well-formedness plus the rules we define in the
HTML5 spec. Thus, for instance, HTML5 forbids, even for XHTML5, to place block
elements inside the <p> element. The lack of a DTD does not prevent us from
operating with this rule. And there is no fundamental difference betwen
defining a rule for <p> and defining a rule for the DOCTYPE. Thus I propose we
do define the rules we want, also for the DOCTYPE declaration.

> (1) is not supported by the XML specification.

That the 'name' part of the DOCTYPE declaration should reflect the root
element, is definitely supported by the XML spec. That the document is
well-formed even if it doesn’t reflect the root, doesn’t change that. Also, on
my question to xmlschema-dev@ regarding whether XSD schema could hypothetically
support validation of DOCTYPE declarations, C. M. Sperberg-McQueen replied:

]] You are quite right that there would be no logical contradiction in a schema
language spec that allowed the kind of check you have in mind.[[
http://lists.w3.org/Archives/Public/xmlschema-dev/2013Feb/0016.html

In other words: We are free to define conformance rules for the DOCTYPE
declaration even if we don’t operate with a DTD.

> (2) I don't think that this is a justification. Authors
>     should be empowered to cry out their love of web 
>     technology wherever they see fit.

I’ll take you seriously once you, within the quirks-mode constraints, propose
the same rule for text/html.

> (3) is a problem for polyglot to address.

The HTML5 specification’s text about DOCTYPE in XHTML5, is needlessly cocky.
The polyglot spec would prefer to get more help from the mother spec in this
case. This wish is congruent with how the mother spec - and not the polygot
spec - *permits* <meta charset="UTF-8"/"> in the XHTML5 syntax despite that it
is useless inside XML documents.

> (4) I don't really understand what you're trying to get at
>     there. I don't think that encouraging validation using 
>     XML Schema is a good practice in any situation.

NU validator & most XML editors are schema based = observation. 

> (5) seems to be a comment about NU.

Even the old validator requires XHTML documents to be complete, with the root
element and all.

> (6) I don't understand, sorry.

The current text in my view gives the impression that everything relating to
DOCTYPE in XHTML5, is up in the air. This isn’t helpful for someone looking for
some guidance.

> Concerning your notes:
> 
> NOTE 1: if your XML editor enforces DTD validation, 
> you are using a brokenXML editor.

NOTE 1 was a comment about parsers - it was not about editors. 

> NOTE 2: but that is already covered by the XML specification.

You are right that *if* someone writes a DTD for XHTML5, then the rules for how
to write DTDs would in fact require the 'html' name part of the DOCTYPE
declaration to be lowercase.

But other than that, XML 1.0 does not specify how to write XHTML5.  XHTML5
might be the only XML dialect where authors would like to use a DTD-less
DOCTYPE. Therefore HTML5 should give some recommendation for this specific
usage.

MODIFIED PROPOSAL:

When a DOCTYPE is used, then, in order "to facilitate migration to and from
XHTML",[1] then it is RECOMMENDED that the 'name' part matches the root element
even when the declaration, such as for <!DOCTYPE html>, doesn’t include a DTD.

And if you like, it is OK for me - and in fact better, if the spec says that
the match should be a case-*in*sensitive match of 'html'. In fact, by making it
a SHOULD/RECOMMENDED rule, we have already allowed deviation from lowercase.

[1]
http://www.w3.org/html/wg/drafts/html/master/document-metadata.html#attr-meta-charset

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 18 February 2013 18:36:48 UTC