summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerald <gerald@localhost>2000-06-30 20:33:50 +0000
committergerald <gerald@localhost>2000-06-30 20:33:50 +0000
commit5edef987c8974c3cb3269c16b111144e6fcebfc0 (patch)
tree00e7c014e830f8fbbc54f71004148c0f513ca14b
parentd322e71b49fb56b34c172541f99c09aef2b8afce (diff)
downloadmarkup-validator-5edef987c8974c3cb3269c16b111144e6fcebfc0.zip
markup-validator-5edef987c8974c3cb3269c16b111144e6fcebfc0.tar.gz
markup-validator-5edef987c8974c3cb3269c16b111144e6fcebfc0.tar.bz2
Made it validate XHTML documents instead of only checking for well-formedness.
Also tweaked the wording accordingly.
-rwxr-xr-xhttpd/cgi-bin/check23
1 files changed, 18 insertions, 5 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index b6663e4..7aceeb8 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -8,7 +8,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.65 2000-05-10 20:24:03 gerald Exp $
+# $Id: check,v 1.66 2000-06-30 20:33:50 gerald Exp $
#
# We need Perl 5.004.
@@ -73,9 +73,9 @@ my $element_ref = 'http://www.htmlhelp.com/reference/html40/';
#
# Strings
-$VERSION = q$Revision: 1.65 $;
+$VERSION = q$Revision: 1.66 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
-$DATE = q$Date: 2000-05-10 20:24:03 $;
+$DATE = q$Date: 2000-06-30 20:33:50 $;
$MAINTAINER = 'gerald@w3.org';
my $notice = ''; # "<p><strong>Note: This service will be ...</strong>";
@@ -342,7 +342,10 @@ if ($File->{Type} eq 'xhtml') {
$ENV{SGML_SEARCH_PATH} = $sgmlstuff . '/REC-xhtml1-20000126/';
$ENV{SP_CHARSET_FIXED} = 'YES';
$ENV{SP_ENCODING} = 'UTF-8';
- $xmlflags = '-wxml -wno-valid ';
+ $xmlflags = '-wxml ';
+ if ( $guessed_doctype != 0 ) { # if no doctype, don't validate
+ $xmlflags .= '-wno-valid ';
+ }
$decl = $xhtmldecl;
} elsif ($guessed_doctype == 2) { # no doctype, with xmlns attr on 1st element
$File->{Type} = 'xml'; # @@ probably a better way to do this
@@ -466,11 +469,16 @@ else {
print ' ' x 2, qq(</ul>\n\n);
if (($File->{Type} eq 'xml') || ($File->{Type} eq 'xhtml')) {
+ my $validity_blurb = "";
+ if ( $guessed_doctype == 0 ) {
+ $validity_blurb = " and validity";
+ }
+
print <<"EOHD";
<p>
Below are the results of checking this document for <a
href="http://www.w3.org/TR/REC-xml#sec-conformance">XML
- well-formedness</a>.
+ well-formedness</a>${validity_blurb}.
</p>
EOHD
@@ -702,7 +710,12 @@ EOHD
}
}
if ( ( $version eq "unknown" ) || ( ! defined $gifname ) ) {
+ if ( $guessed_doctype != 0 ) { # if no doctype, only checked wf-ness
+ print " <p>\n Congratulations, this document is well-formed XML.\n </p>\n";
+ }
+ else { # checked validity
print " <p>\n Congratulations, this document validates as the document type specified! (I don't have an icon for this one yet, sorry.)\n </p>\n";
+ }
}
unless ($q->param('uploaded_file')) {