markup_validator_updated.html 21.6 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='' />
    <meta name="description" content="New release for W3C's most popular open source service: fewer bugs, more document types supported, more fun to hack with, and a few other goodies in the mix." />
    <meta name="revision" content="$Id: markup_validator_updated.html,v 1.42 2011/12/16 03:03:00 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>Markup Validator Updated - W3C Blog</title>

   <link rel="start" href="http://www.w3.org/QA/" title="Home" />
   <link rel="prev" href="http://www.w3.org/QA/2008/07/better_web_education.html" title="Towards better Web professionals" />
   <link rel="next" href="http://www.w3.org/QA/2008/08/the-digital-stakhanovite.html" title="The Digital Stakhanovite" />

   <!--
<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/2008/08/markup_validator_updated.html"
    trackback:ping="http://www.w3.org/QA/sununga/mt-tb.cgi/205"
    dc:title="Markup Validator Updated"
    dc:identifier="http://www.w3.org/QA/2008/08/markup_validator_updated.html"
    dc:subject="Tools"
    dc:description="New release for W3C&apos;s most popular open source service: fewer bugs, more document types supported, more fun to hack with, and a few other goodies in the mix."
    dc:creator="olivier Théreaux"
    dc:date="2008-08-08T13:11:52+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/2008/07/better_web_education.html">&laquo; Towards better Web professionals</a> |
                        <a href="http://www.w3.org/QA/">Main</a>
                        | <a href="http://www.w3.org/QA/2008/08/the-digital-stakhanovite.html">The Digital Stakhanovite &raquo;</a>
                     </p>

                        <h2 class="entry-header">Markup Validator Updated</h2>
                           <div class="entry-body">
                              <p>I tend to keep an eye on things done at CERN. Not just because this is the <a href="http://public.web.cern.ch/public/en/About/Web-en.html" title="the Web was developed by Tim Berners-Lee while he was working at CERN">Web's mothership</a>, but also because there is always a very slim chance that one of their experiments happen to recreate the big bang, kill us all, re-shape the laws of the universe or something else equally exciting and dreadful. After all, it would really be a waste to plan a release of one of our tools after the end of time. So when I started reading about the countdown to the launch of the Large Hadron Collider for <span title="it happens to be a very ominous date in Chinese culture. And my birthday, incidentally.">August 8th, 2008</span> I knew it was time to push that maintenance release of the <a href="http://validator.w3.org/" title="The W3C Markup Validation Service">Markup Validator</a> I had been promising “real soon now” for… the past months.
</p>

<p>As it turns out, our friends in Switzerland will only start <a href="http://public.web.cern.ch/public/en/LHC/LHC-en.html" title="CERN - The Large Hadron Collider">recreating the time just after the big bang</a> in a month. Ah well. Until then, we will have time to enjoy sports on TV, and <a href="http://validator.w3.org/whatsnew.html#t2008-08-08" title="What's New at The W3C Markup Validation Service - 0.8.3 release">the Markup Validator, release 0.8.3</a>.
</p>
<p>This  is mostly a maintenance release, fixing a few 
<a href="http://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;short_desc_type=allwordssubstr&amp;short_desc=&amp;product=Validator&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;status_whiteboard_type=allwordssubstr&amp;status_whiteboard=&amp;keywords_type=allwords&amp;keywords=&amp;bug_status=RESOLVED&amp;resolution=FIXED&amp;emailtype1=substring&amp;email1=&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;chfieldfrom=2007-10-11&amp;chfieldto=2008-08-08&amp;chfield=bug_status&amp;chfieldvalue=&amp;cmdtype=doit&amp;order=Reuse+same+sort+as+last+time&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=">bugs</a>, adding support for recently added or updated document types such as <a href="http://www.w3.org/TR/xhtml-basic/" title="XHTML&#8482; Basic 1.1">XHTML Basic 1.1</a>, but it does have a number of valuable tricks up its sleeves.
</p>
<p>For those of us using the validator not just as a web service but as a web platform, a couple of new features will make our life even easier. First, a json output has been added to the validator's results <a href="http://validator.w3.org/docs/users.html#Output" title="User Documentation for The W3C Markup Validation Service">possible outputs</a>. The format is modeled after <a href="http://wiki.whatwg.org/wiki/Validator.nu_JSON_Output">the JSON output built by our friends at validator.nu</a>. Try this:
</p>
<p><kbd>GET "http://validator.w3.org/check?uri=http://qa-dev.w3.org/wmvs/HEAD/dev/tests/2342-opensp_type_X.html&amp;output=json"</kbd></p>
<p>…you get:</p>
<pre>{
    "url": "http://qa-dev.w3.org/wmvs/HEAD/dev/tests/2342-opensp_type_X.html",
    "messages": [
        
          {
              
              "type": "info",
              "subtype": "warning"
              "lastLine": "11",
              "lastColumn": 20,
              "message": "reference to non-existent ID \"MMIARCH\"",
              "messageid": 183,
              "explanation&quot;: &quot;    
        [...]
    &lt;div class=\&quot;ve mid-183\&quot;&gt;        
    &lt;p&gt;This error can be triggered by:&lt;/p&gt;        
    &lt;ul&gt;        
      &lt;li&gt;A non-existent input, select or textarea element&lt;/li&gt;        
      &lt;li&gt;A missing id attribute&lt;/li&gt;        
      &lt;li&gt;A typographical error in the id attribute&lt;/li&gt;        
    &lt;/ul&gt;        
    &lt;p&gt;Try to check the spelling and case of the id you are referring to.&lt;/p&gt;        
  &lt;/div&gt;        
&quot;,
          }
        
        ],
    "source": {
        "encoding": "utf-8"
    }
}
</pre>
<p>While we are looking at calling the validator and getting quick, easy to process results, did you know that the fastest way to get basic info on validation were the validator's custom HTTP headers? They have been around for a while, now are <a href="http://validator.w3.org/docs/api.html#http_headers">properly documented</a> and we have added information about the number of warnings, too. Try this:</p>

<p><kbd>HEAD http://validator.w3.org/check?uri=http://qa-dev.w3.org/wmvs/HEAD/dev/tests/2342-opensp_type_X.html</kbd></p>
<pre>
    200 OK
    Date: Fri, 08 Aug 2008 15:00:49 GMT
    Content-Language: en
    Content-Type: text/html; charset=utf-8
    Client-Date: Fri, 08 Aug 2008 15:00:52 GMT
    Client-Peer: 128.30.52.49:80
    Client-Response-Num: 1
    X-W3C-Validator-Errors: 0
    X-W3C-Validator-Recursion: 1
    X-W3C-Validator-Status: Valid
    X-W3C-Validator-Warnings: 1
</pre>

<p>Another good piece of news. If you have a vested interest in XHTML, you will know this dilemma fairly well:
</p>
<ul>
    <li>XHTML is supposed to be served with the media type <code>application/xhtml+xml</code> media type. That XHTML media type has a few issues, however, in particular the fact that the most distributed browser, up to now, still hasn't added support for it. </li>
    <li>XHTML 1.0 defined an informative way to be “served as (legacy) HTML”, which kind of worked. But for the rest of the XHTML family…? Some people came up with clever hacks, using HTTP format negotiation to serve XHTML as <code>application/xhtml+xml</code> only to the agents that clearly specify they support this media type, and as <code>text/html</code>, by default, to the others</li>
    <li>What does that have to do with the Markup Validator? It does not declare an authoritative list of the media types it accepts. Actually, it can't, since there is no way in HTTP to say "Accept HTML, SVG, MathML… and any kind of XML". It does not have to, either, since the HTTP technology makes the <code>Accept</code> header optional, and its absence just means “send me what you've got”</li>
    <li>When checking one resource set up with the <code>Accept</code> hack for XHTML, the validator would be served content as <code>text/html</code>, and, since that is <a href="http://www.w3.org/TR/2002/NOTE-xhtml-media-types-20020801/">not supposed to happen</a>, the validator would yield a warning stating, in essence <q>are you certain you really want to serve XHTML 1.1 content as <code>text/html</code>?</q>.</li>
</ul>

<p>It may have been a mere <em>warning</em>, but it made a lot, lot, lot of people anxious and upset. So, by popular demand – and also because the XHTML working group are preparing a <a href="http://www.w3.org/MarkUp/2008/ED-xhtmlmime-20080618/" title="XHTML Media Types - Second Edition">revised note on XHTML and media types</a> − the warning is gone. </p>

<p>Those interested in HTTP content negotiation beyond the issue with XHTML media type will be interested with some new features in the validator. In version <a href="http://validator.w3.org/whatsnew.html#t2007-10-11" title="What's New at The W3C Markup Validation Service">0.8.2</a> we had added a way to specify the <code>Accept:</code> and <code>Accept-Language</code> headers sent by the validator to the server holding documents it checks, and in 0.8.3 we also added <code>Accept-Charset</code> and <code>User-Agent</code>. These <a href="http://validator.w3.org/docs/users.html#Options" title="User Documentation for The W3C Markup Validation Service">options</a> are still experimental, but should be useful for content-negotiated resources that do not have a specific URI for each representation.</p>

<p>There is more in this version, and more to come. Read the <a href="http://validator.w3.org/whatsnew.html#t2008-08-08" title="What's New at The W3C Markup Validation Service - 0.8.3 release">0.8.3 release notes</a>, learn how to <a href="http://validator.w3.org/feedback.html" title="Feedback - W3C Markup Validator">send feedback or participate in the project</a>, and join me in thanking everyone involved in this release.</p>
                           </div>
                           <div id="more" class="entry-more">
                              
                           </div>
                       <p class="postinfo">Filed by <a href="http://www.w3.org/People/olivier/">olivier Théreaux</a> on August  8, 2008  1:11 PM in <a href="http://www.w3.org/QA/archive/w3cqa_news/bugs_life/">Bugs Life</a>, <a href="http://www.w3.org/QA/archive/technology/html/">HTML</a>, <a href="http://www.w3.org/QA/archive/technology/http/">HTTP</a>, <a href="http://www.w3.org/QA/archive/w3cqa_news/tools/">Tools</a><br />
<span class="separator">|</span> <a class="permalink" href="http://www.w3.org/QA/2008/08/markup_validator_updated.html">Permalink</a>
                                 | <a href="http://www.w3.org/QA/2008/08/markup_validator_updated.html#comments">Comments (5)</a>
                                 | <a href="http://www.w3.org/QA/2008/08/markup_validator_updated.html#trackback">TrackBacks (0)</a>
</p>



<h3 class="comments-header" id="comments">Comments</h3>
<div class="comment" id="comment-172250">
<p class="comment-meta" id="c172250">
<span class="comment-meta-author"><strong>David Smalley </strong></span>
<span class="comment-meta-date"><a href="#c172250">#</a> 2009-01-19</span>
</p>
<div class="comment-bulk">
<p>Hi,</p>

<p>I really love returning the information in the HTTP headers! It's removed a bottle neck where I had to run an xml parser over the results, which is always a pain in Ruby. One issue, the CSS parser does not ever seem to return warning counts, only the error counts in the headers.</p>

<p>e.g.</p>

<p>I have a site which returns 1 warning on the html output:</p>

<p>Errors (23) Warnings (1) Validated CSS</p>

<p>But in the headers I only get the errors:</p>

<p>{"cache-control"=>["no-cache"], "x-w3c-validator-status"=>["Invalid"], "x-w3c-validator-errors"=>["23"], "connection"=>["close"], "content-type"=>["text/plain;charset=utf-8"], "date"=>["Mon, 19 Jan 2009 23:38:03 GMT"], "content-language"=>["en"], "server"=>["Jigsaw/2.3.0-beta1"], "content-length"=>["506746"], "pragma"=>["no-cache"]}</p>

<p>The same is not true for the HTML parser, which does correctly return the warnings and errors. Any chance of a fix?</p>

<p>Thanks,</p>

<p>David</p>

</div>
</div>


<div class="comment" id="comment-172507">
<p class="comment-meta" id="c172507">
<span class="comment-meta-author"><strong>olivier Thereaux, W3C </strong></span>
<span class="comment-meta-date"><a href="#c172507">#</a> 2009-01-23</span>
</p>
<div class="comment-bulk">
<p>Hi David,</p>

<p>It looks indeed like the markup validator is the only one with the number of warnings sent via HTTP. The CSS validator does not have that feature yet, but I'll add it in our bugzilla so that we can code it for a future release. Thanks!</p>

</div>
</div>


<div class="comment" id="comment-172765">
<p class="comment-meta" id="c172765">
<span class="comment-meta-author"><strong>Andrew Roberts </strong></span>
<span class="comment-meta-date"><a href="#c172765">#</a> 2009-01-29</span>
</p>
<div class="comment-bulk">
<p>Hi Both</p>

<p>forgive me intruding on this thread as you both sound knowledgeable on the code validation.</p>

<p>I'm a complete novice and looking to remove errors thrown up by my site. Yes - managed to lose all the silly ones with tags unclosed or nested incorrectly, but certain errors I cannot seem to identify why the validator is rejecting it.</p>

<p>for example </p>

<p>
A:hover {TEXT-DECORATION: underline}
</p>

<p>It dislikes the style tag and some 30 or so other issues with the site which is <a href="http://www.discusgroup.co.uk" rel="nofollow">www.DiscusGroup.co.uk</a></p>

<p>Can you help point me in the direction of a user friendly (or more like idiots guide) to help me fix these issues or atleast understand them and accept or reject based on knowledge.</p>

<p>Many thanks for anyone able to assist</p>

</div>
</div>


<div class="comment" id="comment-184023">
<p class="comment-meta" id="c184023">
<span class="comment-meta-author"><strong>Toflar </strong></span>
<span class="comment-meta-date"><a href="#c184023">#</a> 2009-10-10</span>
</p>
<div class="comment-bulk">
<p>Hi all</p>

<p>I was trying to decode your json with php and I've got some troubles because your output seems not to be valid json ;-)</p>

<p><strong>Examples:</strong></p>

<p>current and wrong:</p>

<pre>"subtype": "warning" "lastLine": "18",</pre>

<p>should be: </p>

<pre>"subtype": "warning", "lastLine": "18",</pre>

<p>problem in short:
missing comma</p>

<p>current and wrong:</p>

<pre>"explanation": "xy", }</pre>

<p>should be:</p>

<pre>"explanation": "xy" }</pre>

<p>problem in short:
the explanation is the last item of this array. So putting a comma in front of the closing "}" is wrong.</p>

<p>current and wrong: </p>

<pre>"explanation": "xy",} { "type": "info"</pre>

<p>should be:</p>

<pre>"explanation": "xy"}, { "type": "info"</pre>

<p>problem in short:
Every message should be separated by a comma. so instead of "} {" you should use "}, {". Of course no comma should be added after the last message.</p>

<p>This is the first time I'm working with JSON and I might be wrong. If so, can you give me example of how to use the php function json_decode() with your code?</p>

<p>Thanks for considering my feedback and keep up the good work!</p>

</div>
</div>


<div class="comment" id="comment-184081">
<p class="comment-meta" id="c184081">
<span class="comment-meta-author"><strong>Ted Guild <a class="commenter-profile" href="http://www.w3.org/People/Ted/"><img alt="Author Profile Page" src="http://www.w3.org/QA/sununga/mt-static/images/comment/mt_logo.png" width="16" height="16" /></a></strong></span>
<span class="comment-meta-date"><a href="#c184081">#</a> 2009-10-12</span>
</p>
<div class="comment-bulk">
<p>Toflar,</p>

<p>Thank you for the feedback.  There has been some <a href="http://dev.w3.org/cvsweb/validator/share/templates/en_US/json_output.tmpl">recent fixes in the JSON output</a> including the issues you noted which I have released to the production server.</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="215" />
<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 03:03:00 $</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>