diff options
-rw-r--r-- | htdocs/config/frag.cfg | 22 | ||||
-rwxr-xr-x | htdocs/docs/errors.html | 50 | ||||
-rwxr-xr-x | htdocs/todo.html | 10 | ||||
-rwxr-xr-x | httpd/cgi-bin/check | 65 |
4 files changed, 67 insertions, 80 deletions
diff --git a/htdocs/config/frag.cfg b/htdocs/config/frag.cfg index e6ee042..5f4e0a1 100644 --- a/htdocs/config/frag.cfg +++ b/htdocs/config/frag.cfg @@ -1,8 +1,10 @@ # # Mapping of error message to URI fragment for the explanations. # -# $Id: frag.cfg,v 1.1 1999-12-01 01:04:06 gerald Exp $ +# $Id: frag.cfg,v 1.2 2001-03-06 07:01:47 link Exp $ +# +# Original SP version. entity end not allowed in comment unterm-comment-1 name start character invalid only s and comment allowed in comment declaration unterm-comment-2 name character invalid only s and comment allowed in comment declaration unterm-comment-2 @@ -22,7 +24,19 @@ end tag for FOO which is not finished omitted-content start tag for FOO omitted but its declaration does not permit this no-start-tag general entity FOO not defined and no default entity bad-entity non SGML character number bad-char -cannot generate system identifier for entity FOO bad-pub-id' +cannot generate system identifier for entity FOO bad-pub-id -#error frag -#character data is not allowed here frag +# +# Horribly verbose versions from lq-nsgmls. +document type does not allow element FOO here not-allowed-contained +there is no attribute FOO for this element in this HTML version attr-undef +an attribute value must be quoted if it contains any character other than letters AZaz digits hyphens and periods use quotes if in doubt attr-quoted +element FOO not allowed here possible cause is an inline element containing a blocklevel element not-allowed +element FOO not allowed here check which elements this element may be contained within not-allowed +missing a required subelement of FOO missing-subel +unknown entity FOO bad-entity +end tag for FOO omitted possible causes include a missing end tag improper nesting of elements or use of an element where it is not allowed no-end-tag +start tag was here start-tag +end tag for element FOO which is not open try removing the end tag or check for improper nesting of elements floating-close +element FOO not defined in this HTML version undef-tag +required attribute FOO not specified attr-missing diff --git a/htdocs/docs/errors.html b/htdocs/docs/errors.html index 85c49aa..1710784 100755 --- a/htdocs/docs/errors.html +++ b/htdocs/docs/errors.html @@ -8,8 +8,8 @@ <link rel="stylesheet" type="text/css" href="/base.css" /> <meta name="keywords" content="HTML, Hypertext Markup Language, Validation, W3C HTML Validation Service" /> <meta name="description" content="W3C's easy-to-use HTML validation service, based on an SGML parser." /> - <meta name="revision" content="$Id: errors.html,v 1.1 2001-02-23 09:06:49 link Exp $" /> - <meta name="modified" content="$Date: 2001-02-23 09:06:49 $" /> + <meta name="revision" content="$Id: errors.html,v 1.2 2001-03-06 07:01:47 link Exp $" /> + <meta name="modified" content="$Date: 2001-03-06 07:01:47 $" /> </head> <body bgcolor="#FFFFFF" text="#000000" link="#0000ee" vlink="#551a8b"> @@ -210,23 +210,7 @@ corresponding end tag is also missing</a>. </p> </dd> - <dt id="not-allowed-contained">"document type does not allow element "FOO" here; assuming missing "BAR" start-tag"</dt> - <dd> - <p> - Similar to the <a href="#not-allowed">previous error</a>, but more - specific: in this case, you have a FOO element that is not contained - in a BAR element when FOO is not allowed outside of BAR. Probably the - most common cause of this error is the use of the <code>DD</code> - element as a fake paragraph indent; <code>DD</code> is not allowed - outside of a <code>DL</code> element. - </p> - <p> - The Validator has inserted a BAR start tag where it thinks there needs - to be one; it will probably complain later on that <a - href="#no-end-tag">the corresponding end tag is also missing</a>. - </p> - </dd> - <dt id="undef-attr">"there is no attribute `FOO'"</dt> + <dt id="attr-undef">"there is no attribute `FOO' for this element (in this HTML version)"</dt> <dd> <p> You have used an attribute with an element that is defined not to have @@ -238,7 +222,7 @@ <dt id="undef-attr-val">"`FOO' is not a member of the group specified in the declared value of this attribute"</dt> <dd> <p> - Similar to the <a href="#undef-attr">previous error</a>; this time, + Similar to the <a href="#attr-undef">previous error</a>; this time, you're using an attribute that is defined for the element, but with a value that isn't defined for the attribute. For instance, the Netscape extension <code><IMG ALIGN=ABSMIDDLE></code> will cause this @@ -278,7 +262,7 @@ which means that <code><TD WIDTH="50%"></code> is not allowed. </p> </dd> - <dt id="bad-name-attr">"value of attribute "FOO" invalid: "#" cannot start a name"</dt> + <dt id="attr-bad-name">"value of attribute "FOO" invalid: "#" cannot start a name"</dt> <dd> <p> A special case of <a href="#bad-attr-char">the previous error</a>; the @@ -309,14 +293,15 @@ error, referring to the "attribute value" <code>JOE.GIF</code>. </p> </dd> - <dt id="missing-attr">"required attribute `FOO' not specified"</dt> + <dt id="attr-missing">"required attribute `FOO' not specified"</dt> <dd> <p> You left off a required attribute of the indicated element. The most common such omitted attribute is the <code>ALT</code> attribute of the - <code>AREA</code> element; browsers will typically use these to build - a menu equivalent to your client-side imagemap if the user has - disabled image loading, so you'll want to use a meaningful value here. + <code>AREA</code> or <code>IMG</code> element; browsers will typically + use these to build a menu equivalent to your client-side imagemap if + the user has disabled image loading, so you'll want to use a + meaningful value here. </p> </dd> <dt id="no-end-tag">"end tag for `FOO' omitted, but its declaration does not permit this"</dt> @@ -544,6 +529,21 @@ work from, and thus could not validate your document. </p> </dd> + <dt id="missing-subel">"missing a required sub-element of `FOO'"</dt> + <dd> + <p> + The element "FOO" is defined to <em>require</em> one or more + sub-elements. One example is TR which requires one or more TD or TH + elements. + </p> + </dd> + <dt id="start-tag">"start tag was here"</dt> + <dd> + <p> + Not an error, but rather a pointer to the start tag of the element + the previous error referred to. + </p> + </dd> </dl> </body> </html> diff --git a/htdocs/todo.html b/htdocs/todo.html index 83f56a4..2d79f82 100755 --- a/htdocs/todo.html +++ b/htdocs/todo.html @@ -8,7 +8,7 @@ W3C HTML Validation Service, To Do List"> <meta name="description" content="To Do List for W3C's Validation Service."> <meta name="revision" - content="$Id: todo.html,v 1.26 2001-01-05 00:42:40 gerald Exp $"> + content="$Id: todo.html,v 1.27 2001-03-06 07:01:47 link Exp $"> </head> <body bgcolor="#FFFFFF" text="#000000" link="#0000ee" vlink="#551a8b"> @@ -40,10 +40,6 @@ </p> <ol> - - <li> put error explanations online, re-link them from validator - output - <li> apply <a href="http://lists.w3.org/Archives/Public/www-validator/2000JulSep/0146.html">Takuya's XML encoding patch</a>; merge in <a @@ -61,7 +57,7 @@ <li> add a doctype-overriding option (use <a href="http://lists.w3.org/Archives/Public/www-validator/2000OctDec/0037.html">Terje's - patch</a> + patch</a>). <li> add a textarea for testing short HTML fragments @@ -196,7 +192,7 @@ src="http://validator.w3.org/images/vh40" height=31 width=88 align=right border=0 alt="Valid W3C HTML 4.0!"></a> <a href="/feedback.html">Gerald Oskoboiny</A><br> - $Date: 2001-01-05 00:42:40 $ + $Date: 2001-03-06 07:01:47 $ </address> </body> diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 5e3e70d..7ed6969 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.83 2001-03-06 00:06:00 link Exp $ +# $Id: check,v 1.84 2001-03-06 07:01:48 link Exp $ # # We need Perl 5.004. @@ -43,7 +43,6 @@ use vars qw($frag $pub_ids $element_uri $file_type); # Cfg hashes. # # Paths and file locations -my $logfile = '/var/log/httpd/val-svc'; my $base_path = '/usr/local/validator/'; if ( $ENV{SERVER_PORT} eq "8000" ) { $base_path = '/home/gerald/validator/'; @@ -68,15 +67,15 @@ my $weblint = '/usr/bin/weblint'; # URIs and fragments my $abs_svc_uri = 'http://validator.w3.org/'; my $uri_def_uri = 'http://www.w3.org/Addressing/#terms'; -my $faqloc = 'http://www.cs.duke.edu/~dsb/kgv-faq/'; +my $faqloc = '/docs/'; my $faqerrloc = $faqloc . 'errors.html'; my $element_ref = 'http://www.htmlhelp.com/reference/html40/'; # # Strings -$VERSION = q$Revision: 1.83 $; +$VERSION = q$Revision: 1.84 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; -$DATE = q$Date: 2001-03-06 00:06:00 $; +$DATE = q$Date: 2001-03-06 07:01:48 $; $MAINTAINER = 'gerald@w3.org'; my $notice = ''; # "<p><strong>Note: This service will be ...</strong>"; @@ -102,7 +101,7 @@ my @options = qw(weblint pw outline ss sp noatt); # # Stopgap to shut -w up. It won't actually fix anything, but it'll keep us # running without warnings until we can fix the problems. -my ($validity, %undef_frag, $effective_charset, $catalog, +my ($validity, $effective_charset, $catalog, @fake_errors, $doctype, $line, $col, $type, $msg, $diff, $pos, $indent, $image_uri, $alttext, $gifhw, $pedanticflags, $pedantic_blurb, $level, $prevlevel, $prevdata); @@ -119,7 +118,6 @@ $file_type = &read_cfg($type_db); # Content -> File -type $SIG{TERM} = \&erase_stuff; $SIG{KILL} = \&erase_stuff; $SIG{PIPE} = 'IGNORE'; -# $SIG{CHLD} = \&erase_stuff; # # delete() the, possibly tainted, $PATH. @@ -258,6 +256,7 @@ EOF # my $guessed_doctype = 2; + # # Try to extract or guess the DOCTYPE for HTML and XHTML files. if ($File->{Type} eq 'html' or $File->{Type} eq 'xhtml' @@ -610,7 +609,7 @@ if ( $? || ($guessed_doctype == 1) ) { # "explanation..." links to the KGV FAQ. my $msgindex = $msg; $msgindex =~ s/"[^"]+"/FOO/g; - $msgindex =~ s/[^A-Za-z ]//; + $msgindex =~ s/[^A-Za-z ]//g; $newline =~ s/&/&/go; $newline =~ s/</</go; $newline =~ s/${lt}/</g; $newline =~ s/${gt}/>/g; @@ -631,13 +630,8 @@ if ( $? || ($guessed_doctype == 1) ) { print qq{<span class=error>Error: $msg</span>}; - if ( defined $frag->{$msgindex} ) { - # temporarily commented out due to broken links - # print qq{ (<a - # href="$faqerrloc#$frag->{$msgindex}">explanation...</a>)}; - } - else { # remember msgindexes without frags, to get the KGV FAQ updated. - $undef_frag{$msgindex} = 1; + if (defined $frag->{$msgindex}) { + print qq{ (<a href="$faqerrloc#$frag->{$msgindex}">explanation...</a>)}; } print "</p>\n"; @@ -1064,33 +1058,15 @@ EOF } sub erase_stuff { - - unlink $temp or warn "unlink($temp) returned: $!\n"; - unlink "$temp.esis" or warn "unlink($temp.esis) returned: $!\n"; - unlink "$temp.weblint"; - -} - -sub make_log_entry { - - my $msgindex; - - open(LOG,">>$logfile") || die "couldn't append to log: $!"; - print LOG "$ENV{REMOTE_HOST}\t$validity $version\t", $q->param('uri'), "\n"; - foreach $msgindex (keys %undef_frag) { - print LOG "frag not defined for msgindex: $msgindex\n"; - } - close( LOG ) || die "couldn't close log: $!"; - + unlink $temp or warn "unlink($temp) returned: $!\n"; + unlink "$temp.esis" or warn "unlink($temp.esis) returned: $!\n"; + unlink "$temp.weblint"; } sub clean_up_and_exit { - - &output_closing; - &erase_stuff; -# &make_log_entry; - exit; - + &output_closing; + &erase_stuff; + exit; } sub redirect_to_home_page { @@ -1164,7 +1140,7 @@ sub check_for_doctype { # does an HTML element precede the doctype on the same line? if ( $line =~ /<[a-z].*<!doctype/i ) { - if ( $line =~ /<[a-z]+ xmlns=['"]([^ '"]*)/i ) {# look for an xmlns attr + if ( $line =~ /<[a-z]+ xmlns=['"]([^ "']*)/i ) {# look for an xmlns attr return 2, $1; } last; @@ -1181,7 +1157,7 @@ sub check_for_doctype { # Strip comments, so the next line doesn't find commented-out markup etc. # (this doesn't handle multi-line comments, unfortunately) if ( $line =~ /<[a-z]/i ) { # found an element - if ( $line =~ /<[a-z]+ xmlns=['"]([^ '"]*)/i ) {# look for an xmlns attr + if ( $line =~ /<[a-z]+ xmlns=['"]([^ "']*)/i ) {# look for an xmlns attr return 2, $1; } last; @@ -1286,9 +1262,10 @@ sub print_charset_error { print <<".EOF."; <p> - A fatal error occurred when attempting to transliterate the document charset. - Either we do not support this charset yet, or you have specified a non-existant - character set (typically a misspelling such as "iso8859-1" for "iso-8859-1"). + A fatal error occurred when attempting to transliterate the document + charset. Either we do not support this character encoding yet, or you have + specified a non-existent character set (typically a misspelling such as + "iso8859-1" for "iso-8859-1"). </p> <p>The detected charset was "$charset".</p> <p>The error was "$error".</p> |