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
|
<!--#set var="title" value="User Documentation for The W3C Markup Validator"
--><!--#set var="relroot" value="../"
--><!--#include virtual="../header.html" -->
<div class="doc">
<h2>A user guide for the W3C Markup Validator</h2>
<!--#include virtual="../htmlchecker.html" -->
<p>
If for some reason rather than using the W3C HTML Checker, you want to
use the W3C Markup Validator, this page provides the following information:
</p>
<div id="toc">
<ul>
<li><a href="#Installing">Running your own instance of the W3C Markup Validator</a></li>
<li><a href="#Calling">Using the W3C Markup Validator API</a></li>
<li><a href="#Options">Controlling the behavior of the W3C Markup Validator</a></li>
<li><a href="api.html#http_headers">Using HTTP headers to check validation results</a></li>
</ul>
</div>
<div id="Installing" class="stb">
<h3>Running your own instance of the W3C Markup Validator</h3>
<p>To provide your own service for checking HTML documents, you probably
want to run an instance of the
<a href="https://validator.w3.org/nu/">W3C HTML Checker</a>.
Instructions on how to do that are available in the following guide:
</p>
<ul>
<li><a href="http://validator.github.io/validator/">The Nu Html Checker: Usage, Options, and Web-based checking</a>
</ul>
<p>
To instead run an instance of the W3C Markup Validator, you can find
out more by reading about its
<a href="../source">source code and package availability</a></li>,
along with its
<a href="install.html">installation manual</a></li>
and
<a href="devel.html">an additional guide that provides more information for developers</a></li>.
</p>
</div>
<div id="Calling" class="stb">
<h3>Using the W3C Markup Validator API</h3>
<!--#include virtual="../htmlchecker_api.html" -->
</div>
<div id="Options" class="stb">
<h3>Controlling the behavior of the W3C Markup Validator</h3>
<p>
This section describes the behavior of each of the options exposed in the
W3C Markup Validator user interface, and names of the corresponding
query parameters (shown in parentheses) you can use with the W3C Markup
Validator API.
</p>
<dl>
<dt><a id="option-charset" name="option-charset"></a>Encoding (<code>charset</code>)</dt>
<dd>
<p>This allows you to <strong>override</strong> the character encoding
information about your document. You may use this option for test
purposes, but you will eventually have to serve your document with
the correct character encoding, or the validator will
<a href="help#faq-charset">complain</a> about it and you document
will not be valid.</p>
</dd>
<dt><a id="option-fbc" name="option-fbc"></a>Use Fallback instead of Override
(<code>fbc</code>)</dt>
<dd>
<p>Uses the <a href="#option-charset">character encoding override</a>
mechanism described above, but only does it as a fall back mechanism
if the actual document is not served with character encoding
information. Think of this as a gentler override mechanism.
</p>
</dd>
<dt><a id="option-doctype" name="option-doctype"></a>Document Type
(<code>doctype</code>)</dt>
<dd>
<p>
This allows you to <strong>override</strong> the DOCTYPE declaration
for your document. You may use this option for test purposes, but you
will eventually have to serve your document with the correct DOCTYPE
declaration, or the validator will
<a href="help#faq-doctype">complain</a> about it and you document
will not be valid.
</p>
</dd>
<dt><a id="option-fbd" name="option-fbd"></a>Use Fallback instead of
Override (<code>fbd</code>)</dt>
<dd>
<p>
Uses the <a href="#option-doctype">Doctype override</a> mechanism
described above, but only does it as a fall back mechanism if the
actual document does not have a Doctype declaration. Think of this as
a gentler override mechanism.
</p>
</dd>
<dt><a id="option-ss" name="option-ss"></a>Show Source
(<code>ss</code>)</dt>
<dd>
<p>
Displays the HTML source of the document you validated and links
error messages directly to lines in this output. Makes it easy to see
what's wrong.
</p>
</dd>
<dt><a id="option-outline" name="option-outline"></a>Show Outline
(<code>outline</code>)</dt>
<dd>
<p>
Will generate an outline of your document from the H1 - H6 elements.
For a properly formed document, this will be a nicely nested tree
structure. The visualization of your document's structure makes it
easier to see where you've skipped a heading.
</p>
<p>
If you want to examine the semantic structure of your documents,
beyond the outline, try the
<a href="http://www.w3.org/2003/12/semantic-extractor.html">Semantic
data extractor</a>.
</p>
</dd>
<dt><a id="option-no200" name="option-no200"></a>Validate error pages
(<code>No200</code>)</dt>
<dd>
<p>
The W3C Markup Validator will usually tell you if the page you tried to
validate could not be retrieved (for example, if the server gave a
"404 not found" message. In some circumstances you may want to be
able to validate the error page sent by the server. This is the
option to use then.
</p>
</dd>
<dt><a id="option-verbose" name="option-verbose"></a>Verbose Output
(<code>verbose</code>)</dt>
<dd>
<p>
This option triggers verbose output. Verbose output adds more
explanations and suggestions to the validation results, and gives
more information on the resource validated. This makes it a useful
option if you prefer to be given as much help as possible; if you
prefer more concise reports, leave this option unset.
</p>
</dd>
<dt id="option-accept">For Content-Negotiated resources, set a specific
<code>Accept</code> Header (<code>accept</code>)</dt>
<dd>
<p>
This option (<em>experimental, as of 0.8.2</em>) is useful if your
Web server is set up to use format negotiation, serving different
content based on the preferred/accepted media types of the user
agent. The validator can then emulate different HTTP
<code>Accept</code> behaviors.
</p>
<p>
For example, append
"<code>accept=application%2Fxhtml%2Bxml%2C*</code>" and the validator
will send the HTTP Header
"<code>Accept: application/xhtml+xml,*</code>".
</p>
</dd>
<dt id="option-accept-language">For Content-Negotiated resources, set a
specific <code>Accept-Language</code> Header (<code>accept-language</code>)</dt>
<dd>
<p>
This option (<em>experimental, as of 0.8.2</em>) is useful if your
Web server is set up to use language negotiation, serving content in
different languages based on the preferred/accepted language setup of
the user agent. The validator can then emulate different HTTP
<code>Accept-Language</code> behaviors.
</p>
<p>
For example, append "<code>accept-language=ja%2Cfr</code>" and the
validator will send the HTTP Header
"<code>Accept-Language: ja,fr</code>".
</p>
</dd>
<dt id="option-accept-charset">Set a specific <code>Accept-Charset</code>
Header (<code>accept-charset</code>)</dt>
<dd>
<p>
This option (<em>experimental, as of 0.8.3</em>) makes the validator
send an <code>Accept-Charset</code> HTTP header, specifying the
character encodings which it will accept from server. This option is
mainly used to interface the W3C Markup Validator for
<a href="http://www.w3.org/TR/mobileOK-basic10-tests/#http_request">Mobile
Web Best Practices</a> checking.</p>
</dd>
<dt id="option-user-agent">Set a specific <code>User-Agent</code> Header
(<code>user-agent</code>)</dt>
<dd>
<p>
This option (<em>experimental, as of 0.8.3</em>) makes the validator
send a custom <code>User-Agent</code> HTTP header instead of the
usual <code>W3C_Validator/xx.xxxx</code>. If the value of this
parameter is <code>mobileok</code>, the validator will output a
<code>User-Agent</code> string as defined by the
<a href="http://www.w3.org/TR/mobileOK-basic10-tests/#http_request">Mobile
Web Best Practices</a> spec.</p>
</dd>
</dl>
</div>
</div>
<!--#include virtual="../footer.html" -->
</body>
</html>
|