summaryrefslogtreecommitdiffstats
path: root/httpd/cgi-bin/check
diff options
context:
space:
mode:
authorduerst <duerst@localhost>2001-06-07 09:59:06 +0000
committerduerst <duerst@localhost>2001-06-07 09:59:06 +0000
commite87993c7dd073462a59194aec8574ed5672b7346 (patch)
treeab10442bbfccf2d0fb9c094a0c0c2b5ee6b8264c /httpd/cgi-bin/check
parentb81a541de9a57c9e55008bbf7e5bd507b6715c8b (diff)
downloadmarkup-validator-e87993c7dd073462a59194aec8574ed5672b7346.zip
markup-validator-e87993c7dd073462a59194aec8574ed5672b7346.tar.gz
markup-validator-e87993c7dd073462a59194aec8574ed5672b7346.tar.bz2
Added </ul> to assure even an error produces a valid page;
more code movement to get character encoding issues and DTD issues cleanly separated.
Diffstat (limited to 'httpd/cgi-bin/check')
-rwxr-xr-xhttpd/cgi-bin/check51
1 files changed, 26 insertions, 25 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 866518f..116f3fd 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.113 2001-06-07 09:47:33 duerst Exp $
+# $Id: check,v 1.114 2001-06-07 09:59:06 duerst Exp $
#
# We need Perl 5.004.
@@ -74,9 +74,9 @@ my $element_ref = 'http://www.htmlhelp.com/reference/html40/';
#
# Strings
-$VERSION = q$Revision: 1.113 $;
+$VERSION = q$Revision: 1.114 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
-$DATE = q$Date: 2001-06-07 09:47:33 $;
+$DATE = q$Date: 2001-06-07 09:59:06 $;
$MAINTAINER = 'gerald@w3.org';
$NOTICE = ''; # "<p><strong>Note: This service will be ...</strong>";
@@ -376,28 +376,6 @@ EOHD
print ' ' x 4, qq(</li>\n);
-my $xmlflags = '';
-my $catalog = $sgmlstuff . '/catalog';
-
-if ($File->{Type} eq 'xhtml') {
- $catalog = $sgmlstuff . '/REC-xhtml1-20000126/xhtml.soc';
- $ENV{SP_CHARSET_FIXED} = 'YES';
- $ENV{SP_ENCODING} = 'UTF-8';
- $xmlflags = '-wxml';
-} elsif ($File->{Type} eq 'mathml') {
- $catalog = $sgmlstuff . '/CR-MathML2-20001113/catalog';
- $ENV{SP_CHARSET_FIXED} = 'YES';
- $ENV{SP_ENCODING} = 'XML';
- $xmlflags = '-wxml ';
-} elsif ($File->{Type} eq 'xml') {
- # no doctype, with xmlns attr on 1st element
- $File->{Type} = 'xml'; # @@ probably a better way to do this
- $catalog = $sgmlstuff . '/sp-1.3/pubtext/xml.soc';
- $ENV{SP_CHARSET_FIXED} = 'YES';
- $ENV{SP_ENCODING} = 'XML';
- $xmlflags = '-wxml';
-}
-
unless ($File->{Charset} eq 'utf-8' or $File->{Charset} eq 'unknown') {
# workaround for windows-nnnn charsets missing from glibc<2.2
my $temp_charset = $File->{Charset};
@@ -420,6 +398,7 @@ unless ($File->{Charset} eq 'utf-8' or $File->{Charset} eq 'unknown') {
my $lines = $#lines ? "lines " : "line ";
$lines .= join ", ", @lines;
print <<"EOF";
+ </ul>
<p class="error">
Sorry, I am unable to validate this document because on
<strong>$lines</strong> it contained
@@ -437,6 +416,28 @@ EOF
}
}
+my $xmlflags = '';
+my $catalog = $sgmlstuff . '/catalog';
+
+if ($File->{Type} eq 'xhtml') {
+ $catalog = $sgmlstuff . '/REC-xhtml1-20000126/xhtml.soc';
+ $ENV{SP_CHARSET_FIXED} = 'YES';
+ $ENV{SP_ENCODING} = 'UTF-8';
+ $xmlflags = '-wxml';
+} elsif ($File->{Type} eq 'mathml') {
+ $catalog = $sgmlstuff . '/CR-MathML2-20001113/catalog';
+ $ENV{SP_CHARSET_FIXED} = 'YES';
+ $ENV{SP_ENCODING} = 'XML';
+ $xmlflags = '-wxml ';
+} elsif ($File->{Type} eq 'xml') {
+ # no doctype, with xmlns attr on 1st element
+ $File->{Type} = 'xml'; # @@ probably a better way to do this
+ $catalog = $sgmlstuff . '/sp-1.3/pubtext/xml.soc';
+ $ENV{SP_CHARSET_FIXED} = 'YES';
+ $ENV{SP_ENCODING} = 'XML';
+ $xmlflags = '-wxml';
+}
+
my $command = "$sp -f$temp -E0 $xmlflags -c $catalog";
print "\t<li>nsgmls command line: <code>$command</code>\n" if $DEBUG;