html_and_version_mechanisms.html 18.5 KB
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css" media="all">
    @import "/QA/2006/01/blogstyle.css";
    </style>
    <meta name="keywords" content='html, versioning, web architecture, working group' />
    <meta name="description" content="Disclaimer: This article doesn't represent any kind of consensus in the HTML WG. It is an attempt at capturing the different opinions expressed on the mailing-list. There has a been a lot of debate in April on the HTML WG..." />
    <meta name="revision" content="$Id: html_and_version_mechanisms.html,v 1.94 2011/12/16 02:58:25 gerald Exp $" />    
   <link rel="alternate" type="application/atom+xml" title="Atom" href="http://www.w3.org/QA/atom.xml" />
   <link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="http://www.w3.org/QA/news.rss" />   
   <title>HTML and version mechanisms - W3C Blog</title>

   <link rel="start" href="http://www.w3.org/QA/" title="Home" />
   <link rel="prev" href="http://www.w3.org/QA/2007/04/validator_080_upgrade_notes.html" title="Validator 0.8.0 upgrade notes" />
   <link rel="next" href="http://www.w3.org/QA/2007/05/w3c_at_www2007.html" title="W3C at the 16th WWW Conference." />

   <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
         xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
    rdf:about="http://www.w3.org/QA/2007/05/html_and_version_mechanisms.html"
    trackback:ping="http://www.w3.org/QA/sununga/mt-tb.cgi/52"
    dc:title="HTML and version mechanisms"
    dc:identifier="http://www.w3.org/QA/2007/05/html_and_version_mechanisms.html"
    dc:subject="Opinions &amp; Editorial"
    dc:description="Disclaimer: This article doesn&apos;t represent any kind of consensus in the HTML WG. It is an attempt at capturing the different opinions expressed on the mailing-list. There has a been a lot of debate in April on the HTML WG..."
    dc:creator="Karl Dubost"
    dc:date="2007-05-01T03:29:53+00:00" />
</rdf:RDF>
-->

    <!-- <script type="text/javascript" src="http://www.w3.org/QA/mt.js"></script>-->

</head>
<body class="layout-one-column">
      <div id="banner">
      <h1 id="title">
	<a href="http://www.w3.org/"><img height="48" alt="W3C" id="logo" src="http://www.w3.org/Icons/WWW/w3c_home_nb" /></a>
W3C Blog
</h1>
    </div>
    
    <ul class="navbar" id="menu">
        <li><strong><a href="/QA/" title="W3C Blog Home">[ W3C Blog ]</a></strong></li>
        <li><a href="/QA/Library/" title="Documents and Publications on Web and Quality">Documents</a></li>
        <li><a href="/QA/Tools/" accesskey="3" title="Validators and other Tools">Tools</a></li>
        <li><a href="/2007/12/qa-blog-help/index#feedback">Feedback</a></li>
    </ul>
<div id="searchbox">
<form method="get" action="http://www.google.com/custom" enctype="application/x-www-form-urlencoded">
<p id="formbox"><input type="text" size="15" class="textfield" name="q" accesskey="E" maxlength="255" /> <input type="submit" class="submitfield" value="Search" id="goButton" name="sa" accesskey="G" /> <input type="hidden" name="cof" value="T:black;LW:72;ALC:#ff3300;L:http://www.w3.org/Icons/w3c_home;LC:#000099;LH:48;BGC:white;AH:left;VLC:#660066;GL:0;AWFID:0b9847e42caf283e;" /><input type="hidden" id="searchW3C" name="sitesearch" checked="checked" value="www.w3.org/QA" /><input type="hidden" name="domains" value="www.w3.org/QA" /></p>
</form>
</div>


    <div id="main"><!-- This DIV encapsulates everything in this page - necessary for the positioning -->

                     <p class="content-nav">
                        <a href="http://www.w3.org/QA/2007/04/validator_080_upgrade_notes.html">&laquo; Validator 0.8.0 upgrade notes</a> |
                        <a href="http://www.w3.org/QA/">Main</a>
                        | <a href="http://www.w3.org/QA/2007/05/w3c_at_www2007.html">W3C at the 16th WWW Conference. &raquo;</a>
                     </p>

                        <h2 class="entry-header">HTML and version mechanisms</h2>
                           <div class="entry-body">
                              <p><strong>Disclaimer</strong>: This article doesn't represent any kind of consensus in the <a href="http://www.w3.org/html/wg/">HTML WG</a>. It is an attempt at capturing the different opinions expressed on the mailing-list.</p>

<p>There has a been a lot of debate in <a href="http://lists.w3.org/Archives/Public/public-html/2007Apr/">April on the HTML WG mailing list</a> about versioning. Should the new HTML language bear a version mechanism. It is a difficult topic with interesting arguments. The debate will have certainly influences on discussions on the Technical Architecture Group. Versioning is one of the topics addressed in <a href="http://www.w3.org/TR/webarch/#ext-version">Web Architecture</a>.</p>

<h3 id="no_versioning">no versioning</h3>

<p>html is one language, and every implementations must be able to read its content, whatever happens. All future &#8220;versions&#8221; of html should never dismissed what has been done in the past. Any programs starting from scratch has to implement everything from the start.
The semantics of element will never change as well, because it might break the intent of authors from the past who have written accordingly to a previous version.</p>

<h3 id="versioning">versioning</h3>

<p>People are requesting a version number to be able</p>

<ul>
<li>to switch between two different modes of rendering.</li>
<li>to author with specific requirements and/or semantics</li>
<li>to convert from one version to another one</li>
<li>to create helping tool for authoring document</li>
<li>to validate</li>
<li>to evolve the semantics of elements and attributes</li>
</ul>

<h3 id="html_fragment">html fragment</h3>

<p>There is no simple way for identifying an html fragment used in another application. A version attribute could be done on the root element of this html fragment. It gives a difficult constraint on authoring tool if this html fragment is changed and have to push the version attribute on the new root element.For example, going from </p>

<pre class="html"><code>&lt;p version="foo"&gt;babar&lt;/p&gt;
</code></pre>

<p>to </p>

<pre class="html"><code>&lt;div version="foo"&gt;&lt;p&gt;babar&lt;/p&gt;&lt;/div&gt;
</code></pre>

<h3 id="authors_and_version">Authors and version</h3>

<p><strong>Author</strong>: a version system/mechanism which is constrained to be in the head or DOCTYPE or html element is difficult to change for author with no access to the html template. (ex: CMS with access to content only). On the other side a version number accessible from the body will make it easy to change.</p>

<p><strong>Authoring tool</strong>: The mechanism to change the version is not defined in a conversion context. (ex: HTML editor X taking over HTML editor Y.)</p>

<p><strong>Template designer</strong>: A version number which is not accessible to author might be a feature by constraining author to only a given set of elements.</p>

<h3 id="converter_helping_tools">Converter / Helping tools</h3>

<p>A version number is useful to be able to convert a document to/from an earlier/future version  of the language. It is useful to create an helping tool which gives recommendation depending on the semantics of the feature.</p>

<h3 id="possible_version_syntax_mechanism">Possible Version Syntax mechanism</h3>

<h4 id="8220version8221_attribute">&#8220;version&#8221; attribute</h4>

<p>The version attribute is found on the html element.</p>

<p class="html">&lt;!DOCTYPE html&gt;
&lt;html version=&quot;something&quot;&gt;
&hellip;
&lt;/html&gt;</p>

<p>The format of &#8220;something&#8221; is not defined, but in HTML 4.01
As defined in <a href="http://www.w3.org/TR/html4.01/struct/global.html#adef-version">HTML 4.01</a></p>

<blockquote>
  <p>version = cdata [CN]</p>
  
  <p>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.</p>
</blockquote>

<p>and the DTD for HTML 4.01 <em>Transitional</em> only!</p>

<pre class="html"><code>&lt;!ENTITY % HTML.Version "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;!ENTITY % version "version CDATA #FIXED '%HTML.Version;'"&gt;
&lt;!ATTLIST HTML %i18n;
               %version;
  &gt;
</code></pre>

<p>Then an HTML 4.01 Transitional document would be:</p>

<pre class="html"><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                    "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html version="-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
    &lt;head&gt;
    ...
    &lt;/head&gt;
    &lt;body&gt;
    ...
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>In <a href="http://www.w3.org/TR/REC-html32">HTML 3.2</a>, The DTD declares</p>

<pre class="html"><code>&lt;!ENTITY % HTML.Version "-//W3C//DTD HTML 3.2 Final//EN"&gt;
&lt;!ENTITY % version.attr "VERSION CDATA #FIXED '%HTML.Version;'"&gt;
&lt;!ATTLIST HTML %version.attr;&gt;
</code></pre>

<p>It means an HTML 3.2 document with version information would look like:</p>

<pre class="html"><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"&gt;
  &lt;HTML version="-//W3C//DTD HTML 3.2 Final//EN"&gt;
  &lt;HEAD&gt;
  &lt;TITLE&gt;document title&lt;/TITLE&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
  ... document body
  &lt;/BODY&gt;
  &lt;/HTML&gt;
</code></pre>

<h4 id="8220meta8221_element_for_versioning">&#8220;meta&#8221; element for versioning</h4>

<p>Another possibility for versioning is to use a meta name</p>

<pre class="html"><code>&lt;meta name="version" content="something"/&gt;
</code></pre>

<p>The syntax of something is not defined. Many authoring tools have similar mechanism to advertise that they have created the document and often use a version number.</p>

<h4 id="version_in_http_headers">version in HTTP headers</h4>

<p>In the same way we can specify the content-type with http headers, the version could be given through HTTP headers. It is difficult to modify for authors who have rarely access to the server configuration.</p>

<h4 id="version_in_comments">version in comments.</h4>

<pre class="html"><code>&lt;!-- version: something --&gt;
</code></pre>

<p>A syntax which will be freely consumed by consumer (various user agent) or creator by producer (authoring tool), but that is not required for any class of products. The syntax is still undefined.
An opt-in mechanism specific to a browser vendor makes it difficult to manage in an interoperable way.</p>

                           </div>
                           <div id="more" class="entry-more">
                              
                           </div>
                       <p class="postinfo">Filed by <a href="http://www.w3.org/People/karl/">Karl Dubost</a> on May  1, 2007  3:29 AM in <a href="http://www.w3.org/QA/archive/technology/html/">HTML</a>, <a href="http://www.w3.org/QA/archive/web_spotting/opinions_editorial/">Opinions &amp;amp; Editorial</a><br />
<span class="separator">|</span> <a class="permalink" href="http://www.w3.org/QA/2007/05/html_and_version_mechanisms.html">Permalink</a>
                                 | <a href="http://www.w3.org/QA/2007/05/html_and_version_mechanisms.html#comments">Comments (4)</a>
                                 | <a href="http://www.w3.org/QA/2007/05/html_and_version_mechanisms.html#trackback">TrackBacks (0)</a>
</p>



<h3 class="comments-header" id="comments">Comments</h3>
<div class="comment" id="comment-73317">
<p class="comment-meta" id="c073317">
<span class="comment-meta-author"><strong>Bruno Baketaric </strong></span>
<span class="comment-meta-date"><a href="#c073317">#</a> 2007-10-16</span>
</p>
<div class="comment-bulk">
<p>Neither <strong>Version in comments</strong> nor <strong>Version in HTTP-Headers</strong> is a viable approach in my opinion - for the same reason:
If there's a need for a Version-Information of a HTML-Document it has to be part of the Document.</p>

<p>The HTTP-Header is not part of the Document obviously. And comments - as far as I understand them - may be left out, deleted or whatever without loosing any Information that belongs to "the Document". In the context of a programming language, the software still works, if I delete all comments from the source code, isn't it?.</p>

</div>
</div>


<div class="comment" id="comment-73717">
<p class="comment-meta" id="c073717">
<span class="comment-meta-author"><strong>Karl Dubost, W3C </strong></span>
<span class="comment-meta-date"><a href="#c073717">#</a> 2007-10-18</span>
</p>
<div class="comment-bulk">
<p>I see your point. It is fair indeed. 
About programming languages which contains information in the comments, there is the case of python which puts the <a href="http://www.python.org/dev/peps/pep-0263/" rel="nofollow">Encoding information for programs</a> in a comment. </p>

<p>Some CMSes also rely on the comments to manage the information in the document. That is tricky. I guess part of it lies that Authoring tools developers and content management systems designers are not involved enough in the design of HTML. They might have requirements which are slightly different from the browser vendors. Some requirements for specifically managing content.</p>

</div>
</div>


<div class="comment" id="comment-89625">
<p class="comment-meta" id="c089625">
<span class="comment-meta-author"><strong>Frankie Roberto </strong></span>
<span class="comment-meta-date"><a href="#c089625">#</a> 2007-12-04</span>
</p>
<div class="comment-bulk">
<p>A tricky problem, and one that needs a solution! One use for a version mechanism is in being able to decide whether to, say, serve XHTML1.1 or XHTML5, based upon user agent capabilities or user preferences. Ideally this would be done at an HTTP level, however as both have a application/xhtml+xml MIME type, this is impossible.</p>

<p>The HTML5 spec seems to discourage the XML serialization and instead recommends HTML with the  text/html though, and as this is backwards-compatible with HTML4, there's less of a need for a version mechanism.</p>

</div>
</div>


<div class="comment" id="comment-184955">
<p class="comment-meta" id="c184955">
<span class="comment-meta-author"><strong>Derek Read </strong></span>
<span class="comment-meta-date"><a href="#c184955">#</a> 2009-11-16</span>
</p>
<div class="comment-bulk">
<p>So, is HTML5 no longer considered an application of SGML?</p>

<p>If a "proper" SGML DOCTYPE declaration is to be omitted then this may break many existing SGML editing applications that support validation using any arbitrary DTD. These applications should otherwise be able to handle the new HTML5 DTD, provided they can be given access to it and the DOCTYPE declaration is allowed to reference it, either using a PUBLIC or SYSTEM id. The workaround for these editors would likely need to be to use a "proper" DOCTYPE during editing and then have a "save for the web" mode that alters it to suit the new requirements of HTML5 (by putting in this seemingly odd DOCTYPE that does not contain any  version information).</p>

</div>
</div>



  <div class="comments-open" id="comments-open">
<h3 class="comments-open-header">Leave a comment</h3>

<div class="comments-open-moderated">
   <p>
   Note: this blog is intended to foster <strong>polite
   on-topic discussions</strong>. Comments failing these
   requirements and spam will not get published. Please,
   enter your real name and email address. Every
   individual comment is reviewed by the W3C staff.
   This may take some time, thank you for your patience.
   </p>
   <p>
   You can use the following HTML markup (a href, b, i, 
   br/, p, strong, em, ul, ol, li, blockquote, pre) 
   and/or <a href="http://daringfireball.net/projects/markdown/syntax">Markdown syntax</a>.</p>
</div>

<div id="comments-open-data">
<form method="post" action="http://www.w3.org/QA/sununga/beach.pl" id="comments-form">
<h4>Your comment</h4>
<div id="comments-open-text">
  <textarea id="comment-text" name="text" rows="20" cols="100"></textarea><br />
<label for="comment-text">Write your comment text here. Remember, keep the discussion on topic and courteous.</label>
</div>

<h4>About you</h4>
<div id="comment-form-name">
  <input type="hidden" name="static" value="1" />
<input type="hidden" name="entry_id" value="55" />
<input type="hidden" name="__lang" value="en" /> 
<label for="comment-author">Your Name</label>
<input id="comment-author" name="author" size="30" value="" />
</div>
<div id="comment-form-email">
<label for="comment-email">Your Email Address</label>
<input id="comment-email" name="email" size="30" value="" />
</div>

<div id="comments-open-footer">
<input type="submit" accesskey="s" name="post" id="comment-submit" value="Submit" />

</div>
</form>
</div>
</div>



<p id="gentime">This page was last generated on $Date: 2011/12/16 02:58:25 $</p> 

      </div><!-- End of "main" DIV. -->

<address>

This blog is written by W3C staff and working group participants,<br />
&nbsp;and maintained by <a href="/People/CMercier/">Coralie Mercier</a>.<br />
Authorized parties may <a href="/QA/new">log in</a> to create a new entry.<br/>
<span id="poweredby">Powered by Movable Type, magpierss and a lot of Web Technology</span>
    </address>


    
    <p class="copyright">
      <a rel="Copyright" href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 1994-2011
      <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a>&reg;
      (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
      <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
      <a href="http://www.keio.ac.jp/">Keio</a>),
      All Rights Reserved.
      W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
      <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>,
      <a rel="Copyright" href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
      and <a rel="Copyright" href="http://www.w3.org/Consortium/Legal/copyright-software">software licensing</a>
      rules apply. Your interactions with this site are in accordance
      with our <a href="http://www.w3.org/Consortium/Legal/privacy-statement#Public">public</a> and
      <a href="http://www.w3.org/Consortium/Legal/privacy-statement#Members">Member</a> privacy
      statements.
    </p>

  </body>
</html>