diff options
author | ot <ot@localhost> | 2007-06-21 19:33:50 +0000 |
---|---|---|
committer | ot <ot@localhost> | 2007-06-21 19:33:50 +0000 |
commit | 15ea532e7d863e6f92baf3b900f18fc4cd7cc22a (patch) | |
tree | e00b82b05ba3eb8b6143c617fe15183d7d41b5f0 | |
parent | 5dc909eade05886c13a4ad1d94fda57c975cac8c (diff) | |
download | markup-validator-15ea532e7d863e6f92baf3b900f18fc4cd7cc22a.zip markup-validator-15ea532e7d863e6f92baf3b900f18fc4cd7cc22a.tar.gz markup-validator-15ea532e7d863e6f92baf3b900f18fc4cd7cc22a.tar.bz2 |
adding a case for non-html, non-xml document without a doctype.
-rw-r--r-- | htdocs/config/types.conf | 7 | ||||
-rwxr-xr-x | httpd/cgi-bin/check | 10 | ||||
-rw-r--r-- | share/templates/en_US/warnings.tmpl | 17 |
3 files changed, 31 insertions, 3 deletions
diff --git a/htdocs/config/types.conf b/htdocs/config/types.conf index 60f0f7f..e51e5ba 100644 --- a/htdocs/config/types.conf +++ b/htdocs/config/types.conf @@ -1,7 +1,7 @@ # # Main Document Type Database for the W3C Markup Validation Service. # -# $Id: types.conf,v 1.29 2007-04-20 07:11:31 ot Exp $ +# $Id: types.conf,v 1.30 2007-06-21 19:33:49 ot Exp $ # # Maintains all information for each of the document types we support. # See 'perldoc Config::General' for the syntax, and be aware that the @@ -492,6 +492,11 @@ Allowed = application/xhtml+xml Preferred = application/xhtml+xml </Types> + <Badge> + URI = http://www.w3.org/Icons/valid-xhtml-rdfa + Alt = Valid XHTML + RDFa + </Badge> + </XHTML_RDFa> diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index bf17457..609f1a4 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.526 2007-06-12 11:58:58 ot Exp $ +# $Id: check,v 1.527 2007-06-21 19:33:50 ot Exp $ # # Disable buffering on STDOUT! @@ -181,7 +181,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.526 $; + $VERSION = q$Revision: 1.527 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -2416,6 +2416,12 @@ sub W3C::Validator::SAXHandler::error 'XHTML 1.0 Transitional' : 'HTML 4.01 Transitional' ); add_warning('W09', {W09_dtd => $dtd}); } + else { # not html root element, we are not using fallback + if ($File->{Mode} ne 'XML') { + $File->{'Is Valid'} = FALSE; + add_warning('W09nohtml', {}); + } + } return; # Don't report this as a normal error. } diff --git a/share/templates/en_US/warnings.tmpl b/share/templates/en_US/warnings.tmpl index 9184f52..a8ccce9 100644 --- a/share/templates/en_US/warnings.tmpl +++ b/share/templates/en_US/warnings.tmpl @@ -237,6 +237,23 @@ </li> </TMPL_IF> +<TMPL_IF NAME="W09nohtml"> + <li class="msg_warn" id="W09nohtml"><span class="err_type"><img src="images/info_icons/warning.png" alt="Warning" title="Warning" /></span> <span class="msg">No <code>DOCTYPE</code> found, and unknown root element. Aborting validation.</span> + + <p> + The DOCTYPE Declaration was not recognized or is missing. This + probably means that the Formal Public Identifier contains a spelling + error, or that the Declaration is not using correct syntax, or that + your document is not using a DOCTYPE Declaration. + </p> + <p> + Without a DOCTYPE Declaration it is not possible to check the validity of your document. Since the document does not start with the root <html> element, the validator would not attempt validation on a fall back HTML document type, and aborted the validation process. + </p> + <p>Learn <a href="docs/help.html#faq-doctype">how to add a doctype to your document</a> + from our <acronym title="Frequently Asked Questions">FAQ</acronym>, or use the validator's + option to validate your XML document against a specific Document Type</p> + </li> +</TMPL_IF> <TMPL_IF NAME="W09xml"> <li class="msg_warn" id="W09xml"><span class="err_type"><img src="images/info_icons/warning.png" alt="Warning" title="Warning" /></span> <span class="msg">No <code>DOCTYPE</code> found! Checking XML syntax only.</span> |