Strange error messages when using a "custom DTD"

As many of you know, I propagate the idea of using "custom DTDs" when 
needed
( http://www.cs.tut.fi/~jkorpela/html/own-dtd.html ).
And I know some of you warn that such usage should not be recommended to 
people who do not understand well the idea of DTDs and validation.

Anyway, a markup validator _should_, by definition, perform validation 
by SGML or XML rules, without requiring that only a limited set of DTDs 
be used (or, even less, that only a limited set of DOCTYPE declarations 
be used).

I had some problems with the W3C validator (but not with the 
www.htmlhelp.com validator) when using a DTD developed from an HTML 4.01 
DTD by adding some elements. That is, I encountered the GRPCNT 
limitation.

Therefore I modified the DTD a bit more, removing an element (the Q 
element, which is virtually useless anyway), and got below the GRPCNT 
limit. Now I can use the W3C validator with the "custom DTD"
http://www.cs.tut.fi/~jkorpela/html/special.dtd
although I get a warning "Unable to Determine Parse Mode!" (which is 
somewhat fussy - I think an _informative_ note saying "SGML parsing mode 
used" would be better).

However, when there are markup errors to be reported, the validator 
starts with obscure messages:

"Line 468, Column 36: the number of tokens in a group must not exceed 
GRPCNT (64).

Line 507, Column 36: the number of tokens in a group must not exceed 
GRPCNT (64)."

Sample document (with an intentional markup error, missing </a>):
http://www.cs.tut.fi/~jkorpela/html/validation-problem.html

The line numbers probably relate to my DTD. Lines 468 and 507 start the 
declarations for OBJECT and APPLET, respectively, as copied from HTML 
4.01 Transitional DTD. And this is probably related to the issue that 
the %inline content model has too many alternative elements.

But why does this problem emerge _only_ when there is a syntax error to 
be reported? (The problem also appears when the syntax error is not 
associated with an inline element but e.g. a missing </div>.)

Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/ 

Received on Tuesday, 18 March 2008 13:30:30 UTC