summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlink <link@localhost>2001-09-25 04:53:21 +0000
committerlink <link@localhost>2001-09-25 04:53:21 +0000
commitd8aab2e1dc13a9b528d9ab20060f56e04942d18a (patch)
treee725170ec6d6e606c09929f14069ee22dca97d3b
parent3888d3c6a1d277ecb6dcf9a2ac7705a5a889c85f (diff)
downloadmarkup-validator-d8aab2e1dc13a9b528d9ab20060f56e04942d18a.zip
markup-validator-d8aab2e1dc13a9b528d9ab20060f56e04942d18a.tar.gz
markup-validator-d8aab2e1dc13a9b528d9ab20060f56e04942d18a.tar.bz2
Improve message explanations, add more explanations.
-rw-r--r--htdocs/config/frag.cfg19
-rwxr-xr-xhtdocs/docs/errors.html88
-rwxr-xr-xhttpd/cgi-bin/check10
3 files changed, 110 insertions, 7 deletions
diff --git a/htdocs/config/frag.cfg b/htdocs/config/frag.cfg
index c1c7f68..3aa72e1 100644
--- a/htdocs/config/frag.cfg
+++ b/htdocs/config/frag.cfg
@@ -1,7 +1,7 @@
#
# Mapping of error message to URI fragment for the explanations.
#
-# $Id: frag.cfg,v 1.3 2001-07-14 22:19:59 link Exp $
+# $Id: frag.cfg,v 1.4 2001-09-25 04:53:21 link Exp $
#
# Original SP version.
@@ -42,4 +42,21 @@ 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
+text is not allowed here try wrapping the text in a more descriptive container text-not-allowed
+value of attribute FOO cannot be FOO must be one of FOO unkn-att-val
+character FOO not allowed in attribute specification list possibly caused by a missing quotation mark ending a previous attribute value no-attr-end
+reference to nonSGML character bad-char
+duplicate specification of attribute FOO dup-attr
+an attribute specification must start with a name or name token attr-spec-nmtoken
+invalid comment declaration check your comment syntax inval-comment
+comment declaration started here inval-comment
+element FOO not allowed here assuming missing FOO starttag assuming-missing-starttag
+
+#
+# Reported but not yet explained...
+FOO not finished but containing element ended
+
+#
+# Doesn't work for some reason..?
+invalid attribute value invalid-attr-val
diff --git a/htdocs/docs/errors.html b/htdocs/docs/errors.html
index 546faf6..a829931 100755
--- a/htdocs/docs/errors.html
+++ b/htdocs/docs/errors.html
@@ -1,5 +1,5 @@
-<!--#set var="revision" value="\$Id: errors.html,v 1.15 2001-09-24 10:05:41 link Exp $" -->
-<!--#set var="date" value="\$Date: 2001-09-24 10:05:41 $" -->
+<!--#set var="revision" value="\$Id: errors.html,v 1.16 2001-09-25 04:53:21 link Exp $" -->
+<!--#set var="date" value="\$Date: 2001-09-25 04:53:21 $" -->
<!--#set var="title" value="Error Explanations for The W3C HTML Validation Service" -->
<!--#include virtual="/header.html" -->
@@ -537,7 +537,91 @@
is required and handled by all conforming XML Processors.
</p>
</dd>
+ <dt><a id="text-not-allowed" name="text-not-allowed">" text is not allowed here; try wrapping the text in a more descriptive container"</a></dt>
+ <dd>
+ <p>
+ The document contained bare text where an element was expected.
+ For instance, you must wrap text in <code>&lt;p&gt;</code> if it
+ appears directly inside the <code>&lt;body&gt;</code>.
+ </p>
+ <p>
+ This error may also indicate an unquoted attribute value containing
+ a reserved character (such as "<samp>/</samp>") which terminates the
+ attribute. The net effect is that the rest of the attribute value
+ appears to be plain text, outside any element, to an SGML parser.
+ </p>
+ </dd>
+ <dt><a id="unkn-att-val" name="unkn-att-val">" value of attribute "FOO" cannot be "BAR"; must be one of "FOO", "BAR", "BAZ""</a></dt>
+ <dd>
+ <p>
+ An attribute was specified to contain one of a set of predefined
+ values and you have used a value that is not in that set. The error
+ message tells which attribute value was unknonw and the possible
+ legal values for this attribute.
+ </p>
+ </dd>
+ <dt><a id="no-attr-end" name="no-attr-end">"character FOO not allowed in attribute specification list possibly caused by a missing quotation mark ending a previous attribute value"</a></dt>
+ <dd>
+ <p>
+ A character that is illegal in the attribute list for a particular
+ attribute was encountered. It's is likely that this is a result of
+ a missing quote character on a previous attribute value.
+ </p>
+ </dd>
+ <dt><a id="dup-attr" name="dup-attr">"duplicate specification of attribute "FOO""</a></dt>
+ <dd>
+ <p>
+ You have specified an attribute more than once. For instance, you've
+ used the "height" attribute on the "img" element twice on the same
+ "img" tag.
+ </p>
+ </dd>
+ <dt><a id="invalid-attr-val" name="invalid-attr-val">"invalid attribute value"</a></dt>
+ <dd>
+ <p>
+ The value of this attribute is not a legal value for attributes. For
+ instance, the attribute cannot be the empty string. This is distinct
+ from errors related to illegal values for a specific attribute.
+ </p>
+ </dd>
+ <dt><a id="attr-spec-nmtoken" name="attr-spec-nmtoken">"an attribute specification must start with a name or name token"</a></dt>
+ <dd>
+ <p>
+ An attribute name (and some attribute values) must start with one of
+ a restricted set of characters. This error usually indicates that
+ you have failed to add a closing quotation mark on a previous
+ attribute value (so the attribute value looks like the start of a
+ new attribute) or have used an attribute that is not defined
+ (usually a typo in a common attribute name).
+ </p>
+ </dd>
+ <dt><a id="inval-comment" name="inval-comment">"invalid comment declaration; check your comment syntax"</a></dt>
+ <dd>
+ <p>
+ There is a syntax error in an SGML Comment Declaration. This may be
+ caused by too many or too few hyphens "-" or that you have included
+ an invalid character in the comment. The next message will be
+ "comment declaration started here".
+ </p>
+ </dd>
+ <dt><a id="assuming-missing-starttag" name="assuming-missing-starttag">"element "FOO" not allowed here; assuming missing "BAR" start-tag"</a></dt>
+ <dd>
+ <p>
+ The referenced element "FOO" isn't allowed in the context it occurs
+ in, but it would be if it was wrapped in a "BAR" element. The
+ Validator has assumed that you have forgotten to add a "BAR"
+ starttag and continued validation as if it was there. You should
+ check if this is the case and insert the proper tag.
+ </p>
+ </dd>
+<!--
+ <dt><a id="" name="">""</a></dt>
+ <dd>
+ <p>
+ </p>
+ </dd>
</dl>
+-->
<!--#include virtual="/footer.html" -->
</body>
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 1b79b39..df57e14 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -9,7 +9,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.188 2001-09-25 01:15:28 link Exp $
+# $Id: check,v 1.189 2001-09-25 04:53:21 link Exp $
#
# We need Perl 5.004.
@@ -91,9 +91,9 @@ my $element_ref = 'http://www.htmlhelp.com/reference/html40/';
#
# Strings
-$VERSION = q$Revision: 1.188 $;
+$VERSION = q$Revision: 1.189 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
-$DATE = q$Date: 2001-09-25 01:15:28 $;
+$DATE = q$Date: 2001-09-25 04:53:21 $;
$MAINTAINER = 'gerald@w3.org';
$NOTICE = ''; # "<p><strong>Note: This service will be ...</strong>";
@@ -1357,10 +1357,12 @@ sub report_errors ($) {
# Find index into the %frag hash for the "explanation..." links.
$err->{idx} = $err->{msg};
- $err->{idx} =~ s/"[^\"]+"/FOO/g;
+ $err->{idx} =~ s/"[^\"]*"/FOO/g;
$err->{idx} =~ s/[^A-Za-z ]//g;
$err->{idx} =~ s/\s+/ /g; # Collapse spaces
$err->{idx} =~ s/(^\s|\s$)//g; # Remove leading and trailing spaces.
+ $err->{idx} =~ s/(FOO )+/FOO /g; # Collapse FOOs. :-)
+ $err->{idx} =~ s/FOO FOO/FOO/g; # Collapse FOOs. :-)
$line = &ent($line); # Entity encode.
$line =~ s/\t/ /g; # Collapse TABs.