Annotation of 2002/css-validator/api.html, revision 1.4
1.1 ylafon 1: <?xml version="1.0"?>
2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5: <head>
6: <title>Documentation of the Programmatic Interface (API) to The W3C CSS
7: Validation Service</title>
8: <link rev="made" href="mailto:www-validator-css@w3.org" />
9: <link rev="start" href="./" title="Home Page" />
10: <style type="text/css" media="all">
11: @import "http://validator.w3.org/base.css";</style>
12: <meta name="keywords"
13: content="HTML, HyperText Markup Language, Validation, W3C Markup Validation Service"
14: />
15: <meta name="description"
16: content="W3C's easy-to-use HTML validation service, based on an SGML parser."
17: />
18: <meta name="revision"
1.4 ! ylafon 19: content="$Id: api.html,v 1.3 2006/02/23 13:46:56 ylafon Exp $" />
! 20: <!-- SSI Template Version: $Id: api.html,v 1.3 2006/02/23 13:46:56 ylafon Exp $ -->
1.1 ylafon 21: </head>
22:
23: <body>
24:
25: <div id="banner">
26: <h1 id="title"><a href="http://www.w3.org/"><img height="48" alt="W3C"
27: id="logo" src="http://www.w3.org/Icons/WWW/w3c_home_nb" />
28: </a> <a href="http://www.w3.org/QA/"><img
29: src="http://www.w3.org/QA/2002/12/qa-small.png" alt="QA" />
30: </a> CSS Validation Service</h1>
31: </div>
32: <ul class="navbar" id="menu">
33: <li><span class="hideme"><a href="#skip" accesskey="2"
34: title="Skip past navigation to main part of page">Skip Navigation</a>
35: |</span> <a href="./" accesskey="1"
36: title="Go to the Home Page for The W3C CSS Validation Service"><strong>Home</strong></a></li>
37: <li><a href="http://validator.w3.org/"
38: title="In addition to fixing your CSS, fix your markup with the W3C Markup Validator">Markup
39: Validator</a></li>
40: <li><a href="http://validator.w3.org/checklink"
41: title="In addition to fixing your markup, fix your links with the W3C Link Checker">Link
42: Checker</a></li>
43: </ul>
44:
45: <div id="main">
46: <!-- This DIV encapsulates everything in this page - necessary for the positioning -->
47:
48: <div class="doc">
49: <h2>CSS Validator Web Service API<br />
50: SOAP 1.2 validation interface documentation</h2>
51:
52: <h3 id="TableOfContents">Table of Contents</h3>
53:
54: <div id="toc">
55: <ul>
56: <li><a href="#requestformat">Validation Request Format</a></li>
57: <li><a href="#soap12format">SOAP format description</a>
58: <ul>
59: <li><a href="#soap12_sample">sample SOAP 1.2 validation
60: response</a></li>
61: <li><a href="#soap12response">SOAP1.2 response format reference</a></li>
62: <li><a href="#soap12message">SOAP1.2 atomic message (error or warning)
63: format reference</a></li>
64: </ul>
65: </li>
66: </ul>
67: </div>
68:
69: <p id="skip"></p>
70:
71: <h3 id="requestformat">Validation Request Format</h3>
72:
73: <p>Below is a table of the parameter you can use to send a query to the W3C
74: CSS Validator.</p>
75:
76: <p>If you want to use W3c's public validation server, use the parameters
77: below in conjunction with the following base URI:<br />
78: <kbd>http://jigsaw.w3.org/css-validator/validator</kbd><br />
79: (replace with the address of your own server if you want to call a private
80: instance of the validator.</p>
81:
82: <p><strong>Note</strong>: If you wish to call the validator programmatically
83: for a batch of documents, please make sure that your script will
84: <code>sleep</code> for <strong>at least 1 second</strong> between requests.
85: The CSS Validation service is a free, public service for all, your respect is
86: appreciated. thanks.</p>
87:
88: <table class="refdoc">
89: <tbody>
90: <tr>
91: <th>Parameter</th>
92: <th>Description</th>
93: <th>Default value</th>
94: </tr>
95: <tr>
96: <th>uri</th>
97: <td>The <acronym title="Universal Resource Locator">URL</acronym> of
98: the document to validate. CSS and HTML documents are allowed.</td>
99: <td>None, but either this parameter, or <code>text</code> must be
100: given.</td>
101: </tr>
102: <tr>
103: <th>text</th>
104: <td>The document to validate, only CSS is allowed.</td>
105: <td>None, but either this parameter, or <code>uri</code> must be
106: given.</td>
107: </tr>
108: <tr>
109: <th>usernedium</th>
110: <td>The medium used for the validation, like <code>screen</code>,
111: <code>print</code>, <code>braille</code>....</td>
112: <td><code>screen</code></td>
113: </tr>
114: <tr>
115: <th>output</th>
116: <td>Triggers the various outputs formats of the validator. If unset,
117: the usual Web format will be sent. If set to <code>soap12</code>, the
118: SOAP1.2 interface will be triggered. See <a href="soap12format">below
119: for the SOAP 1.2 response format description</a>.</td>
120: <td>unset</td>
121: </tr>
122: <tr>
123: <th>profile</th>
124: <td>The CSS profile used for the validation. It can be
125: <code>css1</code>, <code>css2</code>, <code>css21</code>,
126: <code>css3</code>, <code>svg</code>, <code>svgbasic</code>,
127: <code>svgtiny</code>, <code>mobile</code>, <code>atsc-tv</code>,
128: <code>tv</code> or <code>none</code></td>
129: <td>By default the profile used is the one from the most recent W3C
130: Recommendation: CSS 2</td>
131: </tr>
132: <tr>
133: <th>lang</th>
134: <td>The language used for the response, currently, <code>en</code>,
135: <code>fr</code>, <code>ja</code>, <code>it</code>, <code>es</code>,
136: <code>zh-cn</code>, <code>nl</code>, <code>de</code>.</td>
137: <td>By default English (<code>en</code>) is used.</td>
138: </tr>
139: <tr>
140: <th>warning</th>
141: <td>The warning level, <code>0</code> for less warnings, <code>1</code>
142: or <code>2</code> for more warnings</td>
143: <td>2</td>
144: </tr>
145: </tbody>
146: </table>
147:
148: <h3 id="soap12format">SOAP format description</h3>
149:
150: <p>When called with parameter <code>output=soap12</code>, the validator will
151: switch to its SOAP 1.2 interface. Below is a sample response, as well as a
152: description of the most important elements of the response.</p>
153:
154: <h4>sample SOAP 1.2 validation request</h4>
155:
156: <p>It is a simple HTTP GET call to a URI like:</p>
157:
158: <p><code>http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.w3.org%2F&warning=0&profile=css2</code></p>
159:
160: <h4 id="soap12_sample">sample SOAP 1.2 validation response</h4>
161:
162: <p>A SOAP response for the validation of a document (invalid) will look like
163: this:</p>
164: <pre style="font-size: smaller"><?xml version='1.0' encoding="utf-8"?>
165: <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
166: <env:Body>
167: <m:cssvalidationresponse
168: env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
169: xmlns:m="http://www.w3.org/2005/07/css-validator">
170: <m:uri>http://www.w3.org/</m:uri>
171: <m:checkedby>http://jigsaw.w3.org/css-validator/</m:checkedby>
172: <m:csslevel>css2</m:csslevel>
173: <m:date>2006.02.23T01:19:57Z</m:date>
174: <m:validity>true</m:validity>
175: <m:result>
176: <m:errors xml:lang="en">
177: <m:errorcount>0</m:errorcount>
178: </m:errors>
179: <m:warnings xml:lang="en">
180: <m:warningcount>79</m:warningcount>
181: <m:warninglist>
182: <m:uri>http://www.w3.org/StyleSheets/home.css</m:uri>
183: <m:warning>
184: <m:line>85</m:line>
185: <m:level>0</m:level>
186: <m:message>Properties for other media might not work for usermedium</m:message>
187: </m:warning>
188: </m:warninglist>
189: <m:warninglist>
190: <m:uri>http://www.w3.org/StyleSheets/home-import.css</m:uri>
191: <m:warning>
192: <m:line>167</m:line>
193: <m:level>0</m:level>
194: <m:message>Properties for other media might not work for usermedium</m:message>
195: </m:warning>
196: <m:warning>
197: <m:line>349</m:line>
198: <m:level>0</m:level>
199: <m:message>Properties for other media might not work for usermedium</m:message>
200: </m:warning>
201: <m:warning>
202: <m:line>362</m:line>
203: <m:level>0</m:level>
204: <m:message>Properties for other media might not work for usermedium</m:message>
205: </m:warning>
206: </m:warninglist>
207: </m:warnings>
208: </m:result>
209: </m:cssvalidationresponse>
210: </env:Body>
211: </env:Envelope></pre>
212:
213: <h4 id="soap12response">SOAP1.2 response format reference</h4>
214:
215: <table class="refdoc">
216: <tbody>
217: <tr>
218: <th>element</th>
219: <th>description</th>
220: </tr>
221: <tr>
222: <th id="soap12_markupvalidationresponse">cssvalidationresponse</th>
223: <td>The main element of the validation response. Encloses all other
224: information about the validation results.</td>
225: </tr>
226: <tr>
227: <th id="soap12_uri">uri</th>
228: <td>the address of the document validated. In <a
229: href="http://www.w3.org/WAI/ER/">EARL</a> terms, this is the
230: <kbd>TestSubject</kbd>.</td>
231: </tr>
232: <tr>
233: <th id="soap12_checkedby">checkedby</th>
234: <td>Location of the service which provided the validation result. In <a
235: href="http://www.w3.org/WAI/ER/">EARL</a> terms, this is the
236: <kbd>Assertor</kbd>.</td>
237: </tr>
238: <tr>
239: <th id="soap12_doctype">csslevel</th>
240: <td>The CSS level (or profile) in use during the validation.</td>
241: </tr>
242: <tr>
243: <th id="soap12_charset">date</th>
244: <td>The actual date of the validation</td>
245: </tr>
246: <tr>
247: <th id="soap12_validity">validity</th>
248: <td>Whether or not the document validated passed or not formal
249: validation (boolean)</td>
250: </tr>
251: <tr>
252: <th id="soap12_errors">errors</th>
253: <td>Encapsulates all data about errors encountered through the
254: validation process</td>
255: </tr>
256: <tr>
257: <th id="soap12_errorcount">errorcount</th>
258: <td>a child of <a href="#soap12_errors">errors</a>, counts the number
259: of errors listed</td>
260: </tr>
261: <tr>
262: <th id="soap12_errorlist">errorlist</th>
263: <td>a child of <a href="#soap12_errors">errors</a>, contains the list
264: of errors (surprise!)</td>
265: </tr>
266: <tr>
267: <th id="soap12_error">error</th>
268: <td>a child of <a href="#soap12_errorlist">errorlist</a>, contains the
269: information on a single validation error.</td>
270: </tr>
271: </tbody>
272: </table>
273:
274: <p><strong>Note</strong>: <code>warnings</code>, <code>warningcount</code>,
275: <code>warninglist</code> and <code>warning</code> are similar to,
276: respectively, <code><a href="#soap12_errors">errors</a></code>, <code><a
1.4 ! ylafon 277: href="#soap12_errorcount">errorcount</a></code>, <code><a
! 278: href="#soap12_errorlist">errorlist</a></code> and <code><a
! 279: href="#soap12_error">error</a></code>.</p>
1.1 ylafon 280:
281: <h4 id="soap12message">SOAP1.2 atomic message (error or warning) format
282: reference</h4>
283:
284: <p>As seen as the example above, the children of the <code><a
285: href="soap12_error">error</a></code> element, but also the
1.2 ylafon 286: <code>warning</code> element are <code>line</code>, <code>level</code> and
1.1 ylafon 287: <code>message</code>, defined below:</p>
288:
289: <table class="refdoc">
290: <tbody>
291: <tr>
292: <th>element</th>
293: <th>description</th>
294: </tr>
295: <tr>
296: <th id="soap12_line">line</th>
297: <td>Within the source code of the validated document, refers to the
298: line where the error was detected.</td>
299: </tr>
300: <tr>
301: <th id="soap12_col">level</th>
302: <td>The level of the warning, only the ones whose level is under or
303: equal to the value specified in the request will be displayed.</td>
304: </tr>
305: <tr>
306: <th id="soap12_message">message</th>
307: <td>The actual error or warning message</td>
308: </tr>
309: </tbody>
310: </table>
311: </div>
312: </div>
313: <!-- End of "main" DIV. -->
314: <address>
315: <a href="../check?uri=referer"><img
316: src="http://www.w3.org/Icons/valid-xhtml10" height="31" width="88"
317: alt="Valid XHTML 1.0!" />
318: </a> Feedback: <a
319: title="Send Feedback for the W3C Markup Validation Service"
1.3 ylafon 320: href="mailto:www-validator-css@w3.org">The W3C CSS Validator Team</a><br />
1.4 ! ylafon 321: $Date: 2006/02/23 13:46:56 $ <!-- SSI Template Version: $Id: api.html,v 1.3 2006/02/23 13:46:56 ylafon Exp $ -->
1.1 ylafon 322:
323: </address>
324:
325: <p class="copyright"><a rel="Copyright"
326: href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
327: © 1994-2006 <a href="http://www.w3.org/"><acronym
328: title="World Wide Web Consortium">W3C</acronym></a>® (<a
329: href="http://www.csail.mit.edu/"><acronym
330: title="Massachusetts Institute of Technology">MIT</acronym></a>, <a
331: href="http://www.ercim.org/"><acronym
332: title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
333: <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
334: href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
335: <a
336: href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>,
337: <a rel="Copyright"
338: href="http://www.w3.org/Consortium/Legal/copyright-documents">document
339: use</a> and <a rel="Copyright"
340: href="http://www.w3.org/Consortium/Legal/copyright-software">software
341: licensing</a> rules apply. Your interactions with this site are in accordance
342: with our <a
343: href="http://www.w3.org/Consortium/Legal/privacy-statement#Public">public</a>
344: and <a
345: href="http://www.w3.org/Consortium/Legal/privacy-statement#Members">Member</a>
346: privacy statements.</p>
347: </body>
348: </html>
Webmaster