Previous section: HTML and SGML
Up to main index
[see parent document for copyright information]
KGV's error messages come straight from nsgmls, and are
generally more understandable than the sgmls error messages
returned by WebTechs, but still sometimes confusing. I've listed here some of
the more common errors produced by KGV, along with (hopefully)
understandable English explanations.
Note that this section is incomplete. I add error messages as I encounter them. If you run into an error that isn't listed here, let me know and I'll try to add it.
<!--' in the document. See the discussion on comment syntax for more
information.
<!-- This is the first unterminated comment >
<!-- This is the second one >
KGV (correctly) interprets the `--' in the second comment
as terminating the first comment, and then interprets the text of the
second comment as text between comments, which is not allowed. See the
discussion on comment syntax for more
information.
<!---- This is not really inside a comment ---->
Despite appearances, the `-' character is significant inside
comment declarations. See the discussion on
comment syntax for more information.
<!invalid
comment>; KGV is (correctly) attempting to interpret it as an
SGML markup declaration. See the
discussion on comment syntax for more
information.
<BODY BGCOLOR> and family (ie. <BODY
BGCOLOR="#FFFFFF">)
<FONT> (ie.
<FONT SIZE="+2">)
<TABLE WIDTH> attribute, if it specifies a
percentage width (ie. <TABLE WIDTH="50%">)
You can also get in trouble by forgetting the closing quote on an attribute. For instance:
<IMG SRC="http://foo.com/fred.gif>
<IMG SRC="http://foo.com/joe.gif>
KGV will (correctly) interpret this as a SRC value of
"http://foo.com/fred.gif> <IMG SRC=", and then choke
on the following `:'. In this case, the position indicator in the
error message may be several lines below the line with the missing
quote.
<IMG SRC="fred.gif>
<!-- 50 lines of stuff -->
<IMG SRC="joe.gif">
the SRC value for the first <IMG> is the entire
fifty lines of stuff up to the next double quote, which probably
exceeds the SGML-defined length limit for
HTML string literals. Note that the position indicator in the error
message points to where the attribute value ended --- in this
case, the "joe.gif" line.
If the tag in question is a frame-related tag, you're out of luck; WebTechs' Mozilla DTD, which KGV uses, does not recognize frames.
There are a lot
of different errors that will generate this error message:
<BODY> and/or
multiple-<TITLE> bugs. Yes, folks, these are in fact
bugs in Netscape 1.1; all versions of Netscape after 1.2 have these bugs
fixed. A variation of this error is the rather common:
<BODY>
<BODY BACKGROUND="bkgnd.gif">
and similar; all of your BODY attributes should be in your first (and
only) <BODY> tag.
<HEAD>...</HEAD> must precede
<BODY>...</BODY>.
<TITLE> must be inside
<HEAD>...</HEAD> (as must a few other elements
like <LINK> and <META>, if you
use them; see the appropriate sections of the HTML2 and HTML3
specs for more information).
<BODY>...</BODY>.
<TABLE><TD>blah</TABLE> will cause this
error. The trick here is that <TABLE> cannot
directly contain <TD>'s; it contains
<TR>'s which contain <TD>'s. The
above example should be
<TABLE><TR><TD>blah</TABLE>.
<BR>'s incorrectly inside
<TABLE>'s. Many people put <BR>'s
at the end of each row of their tables to improve readability on
non-table-aware browsers. This is actually a reasonable thing to do,
but you have to do it the right way. In particular, do not do
this:
<TABLE>
<TR> <TD>blah</TD> <TD>blah</TD> </TR><BR>
<TR> <TD>blah</TD> <TD>blah</TD> </TR><BR>
</TABLE>
This puts the <BR>'s directly inside the
<TABLE>...</TABLE>, which is not
allowed. Instead, do this:
<TABLE>
<TR> <TD>blah</TD> <TD>blah<BR></TD> </TR>
<TR> <TD>blah</TD> <TD>blah<BR></TD> </TR>
</TABLE>
This way, the <BR>'s are inside the
<TD>...</TD>'s, which is
allowed.
DD element as a fake paragraph indent.
DD is not allowed outside of a DL element.
<OL>
<LI>Obtain the following items:
<UL>
<LI>Ham</LI>
<LI>Bread; one of:
<UL>
<LI>White</LI>
<LI>Rye</LI>
<LI>Whole wheat</LI>
</UL>
</LI> <!-- End of the "Bread" <LI> -->
<LI>Cheese</LI>
</UL>
</LI> <!-- End of the "Obtain" <LI> -->
<LI>Place ham and cheese between two slices of bread</LI>
<LI>Consume the resulting ham-and-cheese sandwich</LI>
</OL>
The </LI> end tags are optional and are only included
above to emphasize how the structure of the nested list is arranged; if
you omit them, the parser will infer their presence in the locations
shown above.
KGV has inserted a BAR start tag where it thinks there needs to be one; it will probably complain later on that the corresponding end tag is also missing.
<BODY> without
setting the document type appropriately, and less commonly by using an
HTML 3.0-specific attribute like PLAIN for <UL> or
HEIGHT or WIDTH for <IMG> without identifying your
document as HTML 3.0. See the discussion on choosing a document
type for more information.
If you're using the HTML 3.2 DTD, you'll unfortunately get this error
for any attribute of the STYLE or SCRIPT
elements. HTML 3.2 represents the "state of the art" as of about January
1996, and so has only minimal support for these elements. The Microsoft
IE 3.0 DTD and the Cougar DTD have more complete definitions of these
elements.
<IMG ALIGN=ABSMIDDLE> will
cause this error; ABSMIDDLE isn't one of the allowed values for the
ALIGN attribute of <IMG> (unless, of course, you
provided a Netscape document type, as described in section 1).
If you're using the Netscape document type, the BORDER attribute of
<TABLE> can cause this error. See the discussion of Netscape and tables
for more information.
This error can also be caused, oddly enough, by missing close quotes on attribute values. For instance, given:
<IMG SRC="fred.gif> <IMG SRC="joe.gif>
KGV will (correctly) see a SRC attribute of "fred.gif> <IMG
SRC=", and then try to interpret JOE.GIF as an attribute of
<IMG>.
One potentially annoying source of this error is the TD
WIDTH attribute. Whether intentionally or by oversight, the HTML 3.2
DTD defines this attribute to have a value type of NUMBER, which means
that <TD WIDTH="50%"> is not allowed.
<IMG ISMAP> is actually an abbreviation of
<IMG ISMAP=ISMAP>. (Technically, this also means
that e.g. <P ALIGN=CENTER> could be abbreviated to
<P CENTER>, but it is unlikely that current browsers
will get this right.) KGV has found something that looks like an
abbreviated attribute but doesn't match the value of any attribute for
this element. For instance, a typo like <IMG ISNAP>
would produce this error.
A missing close quote on a previous
attribute value can also trigger this error if the next quote it finds
is followed by something that looks like an abbreviated attribute; for
instance, <IMG SRC="fred.gif><IMG
SRC="joe.gif> would produce this error, referring to the
"attribute value" JOE.GIF.
ALT attribute of the
AREA 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.
<UL><LI><H4>fake font
change</H4></UL> will cause this error, since
headers aren't allowed inside <UL>'s; KGV assumes
that you meant to close the <UL> before opening the
<H4>.
<B><I>nope</B></I> will cause this
error. HTML requires that you close elements ``inside-out'' --- that
is, the last element you opened is the first element you should close.
In this example, you'd have to close the <I> before
the <B>.
<A> tags. Yes, even <A
NAME="foo"> has to have a corresponding
</A>. Note that an empty <A
NAME> element won't be recognized by some browsers; be sure
to put at least a word or two inside the <A>.
<DL>fake indent</DL> will produce
this error, since inside a <DL>, KGV only expects to
see <DT>'s and <DD>'s.
<TABLE WIDTH=100%>. The
previous error should have been that the `%' was "not allowed in attribute specification list". What's happening
here is that, in trying to get past the `%', KGV has become confused and
thinks the `%' is inside the
<TABLE>...</TABLE>, thus triggering the error
message for the previous reason. This error will likely be followed by
mistaken complaints that your <TR>'s are "not allowed here", plus a complaint about your
</TABLE> end tag. The solution is to put the
attribute value in quotes; ie. <TABLE WIDTH="100%">.
<B><I>nope</B></I>, KGV will
insert a </I> before the </B>, and
then will find the </I> after the
</B> and will have nothing to match it with.
A subtle variation of this is <P><H4>fake font
change</H4></P>. <H4>'s
aren't allowed inside <P>'s, but since HTML allows
you to omit the </P> end tag for paragraphs,
KGV assumes that you meant <P></P><H4>fake
font change</H4></P>, in which case the final
</P> is indeed superfluous.
This error can also be caused by incorrectly supplying an end tag for
"empty" elements like <HR>, <BR>
or <IMG>.
TABLE with no TR's
would cause this error.
<UL>fake indent</UL> will cause this
error.
&this;) that it
doesn't recognize. There are a few possibilities:
" in conjunction with the HTML 3.2
DOCTYPE.
This entity was accidentally omitted from the most recent version of the HTML 3.2 DTD.
You should be able to ignore this error safely, though if you wish, you can
replace " with the equivalent character entity
".
in conjunction with the Mozilla
DOCTYPE. WebTechs' Mozilla DTD, which KGV uses,
inexplicably does not define this entity. This error message should
not cause a problem, though you may wish to switch to the equivalent
but more widely handled character entity  .
this&that for
"this&that", which KGV (correctly) interprets as a request for the
entity &that;. Technically, any non-alphanumeric
character (such as a space) will suffice to terminate the entity, but
some browsers get this wrong; the safest thing to do is to terminate all
entities with a semicolon, turning our example into
this&that.
http://host/prog?x=1&y=2". Gerald writes:
This is a common problem: the inventors of CGI didn't think things through very carefully when they decided to use the '&' character as a separator between CGI arguments, because '&' has special status in HTML.
The only way to get around this is for the author of the CGI program to use a different value between arguments, like ';' or '|', which would allow the link to be coded as
<img src="http://site/cgi?opt1=val1;opt2=val2">or whatever.Please contact the maintainer of the CGI program you are linking to, and ask them to use a different character for their separator. (Normally this is extremely easy to add to the CGI program; multiple characters can also be used so existing links using the '&' character will still work.)
This problem is described in the HTML standard, RFC 1866, in section 8.2.1 (footnote 26 in the hypertext version).
Your best bet is to replace the character with the nearest equivalent ASCII character, or to use an appropriate character entity. For more information on ISO8859-1, see Alan Flavell's excellent ISO8859-1/HTML reference.
This error can also be triggered by formatting characters embedded in documents by some word processors. If you use a word processor to edit your HTML documents, be sure to use the "Save as ASCII" or similar command to save the document without formatting information.
™ is defined as the
character entity ™, which is the Unicode
trademark character. Unfortunately, the nsgmls executable
used by KGV does not appear to have 16-bit character support compiled
in, and so it chokes on these 16-bit character entities.
These errors are not produced by anything in your document and should not otherwise affect the validation of your document, so you can pretty much ignore them.
DOCTYPE declaration contains a public identifier that
KGV doesn't recognize. See the discussion
of DOCTYPE for an explanation of what's happening, and
what public identifiers KGV recognizes.
Note that all of the rest of the errors you received are meaningless; KGV was unable to find a DTD to work from, and thus could not validate your document.
DOCTYPE
declaration generated by a popular
HTML editor. You will have to replace this DOCTYPE
with a correct one before attempting to validate your page; replacing
it with a Netscape DOCTYPE may produce fewer errors in the
short run, but this error usually presages a lot of cleanup
work in any event. See the warning in the discussion of
DOCTYPE for an explanation of what's happening.
Note that all of the rest of the errors you received are meaningless; KGV was unable to find a DTD to work from, and thus could not validate your document.
Previous section: HTML and SGML
Up to main index
[see parent document for copyright information]
Sending feedback? Check here first.
Last update 11 Jul 98.
dsb@killerbunnies.org