Re: Doctypes and the dialects of HTML 5

Lachlan Hunt wrote:

>>> from an authors point of view I was wondering how HTML5 will handle
>>> doctypes (I hope we all know why they are important).
>>
>> They were important in SGML era, where there were no namespaces and
>> there was only DTD validation.
>
> They were important for SGML because DTDs described some of the parsing
> rules for the document, like entities and empty elements.  The lack of
> namespaces had nothing to do with it.

Indeed. The original question was related to versioning. SGML files used
public identifier in !DOCTYPE to recognize between different document
types, in XML this is usually done by using namespaces.

>> Yep, versioning is necessary
> 
> Why?
> 
> Browsers are only going to have one parser to handle all HTML on the
> web, not a separate parser for each different version.

I'm not talking about separate parsers. Currently there are several
versions of HTML (Strict, Transitional, Frameset, Print, MP, Basic, ...)
each having slightly different set of elements/attributes. Of course,
typical browser doesn't take care of this -- it just renders what it
knows and ignores rest.

But browser is not only component which deals with HTML markup. Let's
say you for some reason want to use only subset of HTML which is known
to be supported on all mobile devices. You should be able to indicate
which version of HTML you are using for tools which are used to generate
markup (e.g. HTML editor) or check markup (validator which checks that
you are using only elements that are defined in particular version of
HTML). Of course you can specify version you want to use in your
editor/validator/... externally, but this very impractical and it
doesn't work.

>> HTML already offers different way of specifying version used --
>> profile attribute on head element.
> 
> The profile attribute is not defined for versioning at all.  Please see
> the definition in the HTML4 spec.

Strictly speaking no, but several W3C specification use it this way
(e.g. XHTML Print).

>> What will be more suitable is version attribute allowed on root element
>> (html) and also on other elements which can act as roots of HTML
>> fragments (e.g. div). So for specifying that you are using HTML 5.0 you
>> could write:
>>
>> <html version="5.0">
> 
> Why would that be useful?  You first need to explain what purpose
> versioning serves in HTML.  What are the use cases?  Why should authors
> bother using it?

See above.

> HTML4 had a version attribute.  It was deprecated and has seen virtually
> no use in the real world.  The spec also lacked any processing
> requirements and didn't even define what values could be used.
> 
> http://www.w3.org/TR/html401/struct/global.html#adef-version

But it was deprecated because at the time of HTML 4 development the
intent was that !DOCTYPE will carry version information:

"Deprecated. The value of this attribute specifies which HTML DTD
version governs the current document. This attribute has been deprecated
because it is redundant with version information provided by the
document type declaration."

Nowadays it is known that !DOCTYPE is really not very useful for this
purpose.

I don't think that there should be any processing expectations for
version attribute defined. However rules for composing version
identifier should be defined. E.g. something like DocBook uses:

http://www.docbook.org/tdg5/en/html/ch05.html#s-notdocbook

>> Dan, if you are reading this could you please add problem of versioning
>> to the list of issues? Thanks.
> 
> Please don't, it's not an issue.  Let's not waste any more time than
> necessary on proposals that have no clear use cases.

Is the above mentioned ability to indicate which version of HTML you
intended to use (for example for HTML editing tool) good enough use case
for you and others?

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member
------------------------------------------------------------------
 Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html

Received on Saturday, 24 March 2007 20:37:32 UTC