summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorot <ot@localhost>2007-07-09 04:56:27 +0000
committerot <ot@localhost>2007-07-09 04:56:27 +0000
commit0c4abf455ae1174c727b723fe3b3d530a9d1498a (patch)
tree3b9122fe1635c3a044f77981441fff4308017c56
parent862770a8dca1d0603728d5df8de820b641a748c6 (diff)
downloadmarkup-validator-0c4abf455ae1174c727b723fe3b3d530a9d1498a.zip
markup-validator-0c4abf455ae1174c727b723fe3b3d530a9d1498a.tar.gz
markup-validator-0c4abf455ae1174c727b723fe3b3d530a9d1498a.tar.bz2
making the X-W3C-Validator-Status header more consistently report:
* Valid if validation passed * Invalid if validation proceeded, failed * Abort if validation could not be performed
-rwxr-xr-xhtdocs/docs/api.html10
-rwxr-xr-xhtdocs/docs/users.html5
-rwxr-xr-xhttpd/cgi-bin/check8
-rw-r--r--share/templates/en_US/earl_n3.tmpl5
-rw-r--r--share/templates/en_US/earl_xml.tmpl5
-rw-r--r--share/templates/en_US/header.tmpl5
-rw-r--r--share/templates/en_US/soap_fault.tmpl5
-rw-r--r--share/templates/en_US/soap_output.tmpl5
-rw-r--r--share/templates/en_US/ucn_output.tmpl5
-rw-r--r--share/templates/en_US/xml_output.tmpl5
10 files changed, 36 insertions, 22 deletions
diff --git a/htdocs/docs/api.html b/htdocs/docs/api.html
index b6dcb31..cabb745 100755
--- a/htdocs/docs/api.html
+++ b/htdocs/docs/api.html
@@ -1,5 +1,5 @@
-<!--#set var="revision" value="\$Id: api.html,v 1.10 2007-07-05 01:58:54 ot Exp $"
---><!--#set var="date" value="\$Date: 2007-07-05 01:58:54 $"
+<!--#set var="revision" value="\$Id: api.html,v 1.11 2007-07-09 04:56:26 ot Exp $"
+--><!--#set var="date" value="\$Date: 2007-07-09 04:56:26 $"
--><!--#set var="title" value="Documentation of the Programmatic Interface (API) to The W3C Markup Validation Service"
--><!--#set var="relroot" value="../"
--><!--#include virtual="../header.html" -->
@@ -313,8 +313,10 @@ element, but also the <code>warning</code> element are <code>line</code>, <code>
<tr><th>Header</th><th>Value</th><th>Notes</th></tr>
<tr>
<td>X-W3C-Validator-Status</td>
- <td><code>Valid</code> or <code>Invalid</code></td>
- <td>May not be present if validation could not be performed (404 Not found, etc)</td>
+ <td><code>Valid</code> or <code>Invalid</code> if validation was performed.<br />
+ value will be <code>Abort</code> if a fatal error (decoding, 404 not found, etc)
+ was encountered and validation could not be performed</td>
+ <td>Note: <code>Abort</code> value was added in version 0.8.0</td>
</tr>
<tr>
<td>X-W3C-Validator-Errors</td>
diff --git a/htdocs/docs/users.html b/htdocs/docs/users.html
index 1574ceb..d2cdd5e 100755
--- a/htdocs/docs/users.html
+++ b/htdocs/docs/users.html
@@ -1,5 +1,5 @@
-<!--#set var="revision" value="\$Id: users.html,v 1.26 2006-11-15 08:02:46 ot Exp $"
---><!--#set var="date" value="\$Date: 2006-11-15 08:02:46 $"
+<!--#set var="revision" value="\$Id: users.html,v 1.27 2007-07-09 04:56:26 ot Exp $"
+--><!--#set var="date" value="\$Date: 2007-07-09 04:56:26 $"
--><!--#set var="title" value="User Documentation for The W3C Markup Validation Service"
--><!--#set var="relroot" value="../"
--><!--#include virtual="../header.html" -->
@@ -23,6 +23,7 @@
<ul>
<li><a href="#Options">Options and Parameters</a></li>
<li><a href="#Output">Output Formats</a></li>
+ <li><a href="api.html#http_headers">Using HTTP headers to know validation results</a></li>
<li><a href="#deprecated_options">Deprecated options</a></li>
</ul>
</li>
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 33b3e3c..76d4ddb 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -14,7 +14,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.535 2007-07-05 07:10:01 ot Exp $
+# $Id: check,v 1.536 2007-07-09 04:56:27 ot Exp $
#
# Disable buffering on STDOUT!
@@ -181,7 +181,7 @@ Directory not readable (permission denied): @_r
#
# Strings
- $VERSION = q$Revision: 1.535 $;
+ $VERSION = q$Revision: 1.536 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
#
@@ -1011,6 +1011,10 @@ sub prep_template ($$) {
my $over_charset_param = "override charset $File->{Opt}->{Charset}";
$T->param($over_charset_param => TRUE);
}
+
+ if ($File->{'Error Flagged'}) {
+ $T->param(fatal_error => TRUE);
+ }
}
sub fin_template ($$) {
diff --git a/share/templates/en_US/earl_n3.tmpl b/share/templates/en_US/earl_n3.tmpl
index cab2cdd..5086963 100644
--- a/share/templates/en_US/earl_n3.tmpl
+++ b/share/templates/en_US/earl_n3.tmpl
@@ -1,7 +1,8 @@
Content-Type: text/plain; charset=UTF-8
-X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="valid_status">
+X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="fatal_error">
+X-W3C-Validator-Status: Abort<TMPL_ELSE><TMPL_IF NAME="valid_status">
X-W3C-Validator-Status: <TMPL_VAR NAME="valid_status"></TMPL_IF>
-X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num">
+X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num"></TMPL_IF>
@prefix earl: <http://www.w3.org/2001/03/earl/1.0-test#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
diff --git a/share/templates/en_US/earl_xml.tmpl b/share/templates/en_US/earl_xml.tmpl
index 2c65590..77a45a5 100644
--- a/share/templates/en_US/earl_xml.tmpl
+++ b/share/templates/en_US/earl_xml.tmpl
@@ -1,7 +1,8 @@
Content-Type: application/rdf+xml; charset=UTF-8
-X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="valid_status">
+X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="fatal_error">
+X-W3C-Validator-Status: Abort<TMPL_ELSE><TMPL_IF NAME="valid_status">
X-W3C-Validator-Status: <TMPL_VAR NAME="valid_status"></TMPL_IF>
-X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num">
+X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num"></TMPL_IF>
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
diff --git a/share/templates/en_US/header.tmpl b/share/templates/en_US/header.tmpl
index 2ba921d..109b50b 100644
--- a/share/templates/en_US/header.tmpl
+++ b/share/templates/en_US/header.tmpl
@@ -1,8 +1,9 @@
Content-Language: en
Content-Type: text/html; charset=utf-8
-X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="valid_status">
+X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="fatal_error">
+X-W3C-Validator-Status: Abort<TMPL_ELSE><TMPL_IF NAME="valid_status">
X-W3C-Validator-Status: <TMPL_VAR NAME="valid_status"></TMPL_IF>
-X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num">
+X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num"></TMPL_IF>
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
diff --git a/share/templates/en_US/soap_fault.tmpl b/share/templates/en_US/soap_fault.tmpl
index e4b4646..904a4a2 100644
--- a/share/templates/en_US/soap_fault.tmpl
+++ b/share/templates/en_US/soap_fault.tmpl
@@ -1,7 +1,8 @@
Content-Type: application/soap+xml; charset=UTF-8
-X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="valid_status">
+X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="fatal_error">
+X-W3C-Validator-Status: Abort<TMPL_ELSE><TMPL_IF NAME="valid_status">
X-W3C-Validator-Status: <TMPL_VAR NAME="valid_status"></TMPL_IF>
-X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num">
+X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num"></TMPL_IF>
<?xml version='1.0' encoding="utf-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
diff --git a/share/templates/en_US/soap_output.tmpl b/share/templates/en_US/soap_output.tmpl
index 5fdc18c..fc7f131 100644
--- a/share/templates/en_US/soap_output.tmpl
+++ b/share/templates/en_US/soap_output.tmpl
@@ -1,7 +1,8 @@
Content-Type: application/soap+xml; charset=UTF-8
-X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="valid_status">
+X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="fatal_error">
+X-W3C-Validator-Status: Abort<TMPL_ELSE><TMPL_IF NAME="valid_status">
X-W3C-Validator-Status: <TMPL_VAR NAME="valid_status"></TMPL_IF>
-X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num">
+X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num"></TMPL_IF>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
diff --git a/share/templates/en_US/ucn_output.tmpl b/share/templates/en_US/ucn_output.tmpl
index e688ae4..4a3a2b0 100644
--- a/share/templates/en_US/ucn_output.tmpl
+++ b/share/templates/en_US/ucn_output.tmpl
@@ -1,7 +1,8 @@
Content-Type: application/xml; charset=UTF-8
-X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="valid_status">
+X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="fatal_error">
+X-W3C-Validator-Status: Abort<TMPL_ELSE><TMPL_IF NAME="valid_status">
X-W3C-Validator-Status: <TMPL_VAR NAME="valid_status"></TMPL_IF>
-X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num">
+X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num"></TMPL_IF>
<?xml version="1.0" encoding="UTF-8"?>
<observationresponse xmlns="http://www.w3.org/unicorn/observationresponse"
diff --git a/share/templates/en_US/xml_output.tmpl b/share/templates/en_US/xml_output.tmpl
index d11b0dd..7ef5eaf 100644
--- a/share/templates/en_US/xml_output.tmpl
+++ b/share/templates/en_US/xml_output.tmpl
@@ -1,7 +1,8 @@
Content-Type: application/xml; charset=UTF-8
-X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="valid_status">
+X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="fatal_error">
+X-W3C-Validator-Status: Abort<TMPL_ELSE><TMPL_IF NAME="valid_status">
X-W3C-Validator-Status: <TMPL_VAR NAME="valid_status"></TMPL_IF>
-X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num">
+X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num"></TMPL_IF>
<?xml version="1.0" encoding="UTF-8"?>
<!--