This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1815 - Line number shift when using doctype override
Summary: Line number shift when using doctype override
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.7.0
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Olivier Thereaux
QA Contact: qa-dev tracking
URL: http://www.beyondthepixel.net/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-25 22:37 UTC by Naram Qashat
Modified: 2005-07-27 09:20 UTC (History)
0 users

See Also:


Attachments

Description Naram Qashat 2005-07-25 22:37:20 UTC
The URL I gave is my friend's website, and I was putting it through the
validator to see what comes up.  I have tried the validator in 2 ways, without
giving an override on the DOCTYPE, and giving one to HTML 4.01 Transitional. 
The site does not have a DOCTYPE declaration, so it's technically not valid anyways.

With the beta, if I do not override the DOCTYPE not being there, it gives a
message saying it'll validate using HTML 4.01 Transitional as a fallback, but
some of the errors that come up are valid for HTML 4.01 Transitional.  The first
error:

Line 1, column 0: no document type declaration; implying "<!DOCTYPE HTML SYSTEM>"

seems to make me think it is not using HTML 4.01 Transitional's DTD, but that I
can't say for sure since it does not show what DOCTYPE declaration it's trying
to use in the source.  I used the following URL:

http://validator.w3.org:8001/check?uri=www.beyondthepixel.net&charset=%28detect+automatically%29&doctype=Inline&ss=1&verbose=1

The production validator seems to be doing things correctly and using the right
fallback.

Now, if I explicitly override the DOCTYPE to HTML 4.01 Transitonal, the
production validator still gives the same errors it did before, which seems like
correct behavior.  But the beta does something strange.  Using this URL:

http://validator.w3.org:8001/check?uri=http%3A%2F%2Fwww.beyondthepixel.net%2F&charset=%28detect+automatically%29&doctype=HTML+4.01+Transitional&ss=1&verbose=1

The first error that comes up:

Line 96, column 18: there is no attribute "BACKGROUND" .

That is a valid problem, BUT it's showing the wrong line and column.  The
background attribute is actually on the previous line, line 95, at column 5.

One other things that is relatively minor:  I noticed the beta does not show
number of errors like the production one does.  Is this because of the fact that
the beta shows not only errors, but warnings and notices as well?
Comment 1 Olivier Thereaux 2005-07-26 03:09:32 UTC
(In reply to comment #0)
> The site does not have a DOCTYPE declaration, so it's technically not valid anyways.

Right.
 
> With the beta, if I do not override the DOCTYPE not being there, it gives a
> message saying it'll validate using HTML 4.01 Transitional as a fallback, but
> some of the errors that come up are valid for HTML 4.01 Transitional.

When using the fallback DTD, some errors regarding named entities were indeed wrong. This is being 
fixed (see e.g at the bottom of http://lists.w3.org/Archives/Public/www-validator/2005Jul/0059.html )

>  The first error:
> Line 1, column 0: no document type declaration; implying "<!DOCTYPE HTML SYSTEM>"
> seems to make me think it is not using HTML 4.01 Transitional's DTD

It is using the fallback DTD. it's just the parser's jargon not being clear. The explanation that goes with 
it is supposed to clarify this.

> Line 96, column 18: there is no attribute "BACKGROUND" .
> That is a valid problem, BUT it's showing the wrong line and column.  The
> background attribute is actually on the previous line, line 95, at column 5.

Indeed, that's a bug I was not aware of. Cannot see anything similar in bugzilla either. Good catch. I am 
changing the title of this bug report to be this particular issue.


> One other things that is relatively minor:  I noticed the beta does not show
> number of errors like the production one does.  Is this because of the fact that
> the beta shows not only errors, but warnings and notices as well?

Mostly, yes. No-one in all the alpha, beta test periods asked to get it back, either. I am filing a separate 
enhancement request (Bug #1816) for it.
Comment 2 Olivier Thereaux 2005-07-27 09:20:51 UTC
fixed in CVS, will be in the next beta.