markup_validator_updated.html
21.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<?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'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">« 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 »</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&short_desc_type=allwordssubstr&short_desc=&product=Validator&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=RESOLVED&resolution=FIXED&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=2007-10-11&chfieldto=2008-08-08&chfield=bug_status&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&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™ 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&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": "
[...]
<div class=\"ve mid-183\">
<p>This error can be triggered by:</p>
<ul>
<li>A non-existent input, select or textarea element</li>
<li>A missing id attribute</li>
<li>A typographical error in the id attribute</li>
</ul>
<p>Try to check the spelling and case of the id you are referring to.</p>
</div>
",
}
],
"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 />
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> © 1994-2011
<a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a>®
(<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>