By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,874 Members | 1,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,874 IT Pros & Developers. It's quick & easy.

Unknown Parse Mode! warning from w3c validator with custom doctype

P: n/a
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm
uses a custom DTD, the w3c validator validates it but with this warning:

"Unknown Parse Mode!

The MIME Media Type (text/html) for this document is used to serve both
SGML and XML based documents, and it is not possible to disambiguate it
based on the DOCTYPE Declaration in your document. Parsing will continue
in SGML mode."
http://validator.w3.org/check?uri=ht...custom_dtd.htm

Afaics the validator should parse in 2 stages, first to retrieve the url
to the custom DTD, after which there should be no ambiguity about
parsing the document as SGML or XML, so why does the w3c validator issue
the warning?

The WDG and Page valet validators don't issue such a warning:
http://www.htmlhelp.com/cgi-bin/vali...m&warnings=yes
http://valet.webthing.com/view=Asis/...&parseMode=web

--
Spartanicus
Sep 6 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Spartanicus a écrit :
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm
uses a custom DTD, the w3c validator validates it but with this warning:

"Unknown Parse Mode!

The MIME Media Type (text/html) for this document is used to serve both
SGML and XML based documents, and it is not possible to disambiguate it
based on the DOCTYPE Declaration in your document. Parsing will continue
in SGML mode."
http://validator.w3.org/check?uri=ht...custom_dtd.htm

Afaics the validator should parse in 2 stages, first to retrieve the url
to the custom DTD, after which there should be no ambiguity about
parsing the document as SGML or XML, so why does the w3c validator issue
the warning?

The WDG and Page valet validators don't issue such a warning:
http://www.htmlhelp.com/cgi-bin/vali...m&warnings=yes
http://valet.webthing.com/view=Asis/...&parseMode=web


You may want to open an account at W3C and add a comment here:

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1809

I certainly would appreciate this since this unknown parse mode warning
is a regression IMO.

Gérard
--
remove blah to email me
Sep 7 '05 #2

P: n/a
Gérard Talbot <ne***********@gtalbot.org> wrote:
You may want to open an account at W3C and add a comment here: - - I certainly would appreciate this since this unknown parse mode warning
is a regression IMO.
I'm not particularly enthusiastic about bug reporting systems that
require the reporter to register just to help the maintenance of some
software. I understand concerns with spamming, but forced registration
makes spamming the volunteer helper's problem, which means less
volunteers.

Anyway, if someone wishes to contribute to fixing the problem, I'd
suggest mentioning that the message is verbally wrong (as well as
questionable in general). It's not a matter of unknown parse mode. The
validator knows the two parse modes well. It's just unwilling to make a
choice between them without making noise about it. "Unresolved parse
mode" would be a bit better.
Afaics the validator should parse in 2 stages, first to retrieve the
url to the custom DTD, after which there should be no ambiguity about
parsing the document as SGML or XML, so why does the w3c validator
issue the warning?


As far as I know, the validator is a conglomerate that uses an old SGML
parser and a newer XML parser, and the DTD parsing is handled by them as
well. Therefore it needs to select the parser at an early stage. And
apparently it defaults to SGML parsing for text/html. You can even feed
XHTML to it that way.

If it first tried to parse the DTD as an SGML DTD and switch to XML
parsing if errors are found in the DTD, we would probably get even
stranger error messages than today if there is an error in the DTD - or
just a feature that exceeds the capacity limitations of the validator.
They still haven't fixed the GRPCNT limitation, or added reporting of DTD
problems, so for a document like
http://www.cs.tut.fi/~jkorpela/html/nobr.html I still get "Failed
validation, 0 error".

So instead of reporting problems with the W3C validator, I use the WDG
validator.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Sep 7 '05 #3

P: n/a
In article <Xn*****************************@193.229.0.31>,
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote:
As far as I know, the validator is a conglomerate that uses an old SGML
parser and a newer XML parser, and the DTD parsing is handled by them as
well. Therefore it needs to select the parser at an early stage.


AFAIK, the W3C Validator does not have an XML parser at all. It has an
SGML parser and the "parse mode" means the choice of SGML declaration.

It can be proven by demonstration that the W3C Validator does not use an
XML processor as defined in the XML 1.0 spec and, therefore, is not an
XML validator:
http://hsivonen.iki.fi/test/ill-formed-but-sgml-valid/

See also the thread that starts at
http://lists.w3.org/Archives/Public/...5Sep/0009.html

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Sep 7 '05 #4

P: n/a
Spartanicus wrote:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm
uses a custom DTD, the w3c validator validates it but with this warning:

"Unknown Parse Mode!

The MIME Media Type (text/html) for this document is used to serve both
SGML and XML based documents, and it is not possible to disambiguate it
based on the DOCTYPE Declaration in your document. Parsing will continue
in SGML mode."
http://validator.w3.org/check?uri=ht...custom_dtd.htm
I agree that's a regression.

It's dealing with a problem you don't have: namely people using
nonstandard XHTML DTDs and getting a bunch of unexpected errors
due to SGML-mode parsing. Although it is correct to parse as
SGML (XHTML 1.0 makes an exception, but that applies _only_ to
the three listed doctypes), it was generating confusion and
bug reports.
Afaics the validator should parse in 2 stages, first to retrieve the url
to the custom DTD, after which there should be no ambiguity about
parsing the document as SGML or XML, so why does the w3c validator issue
the warning?
The underlying parser can't do that. By the time it fetches your DTD,
it is already firmly in one mode or the other. It can use the media
type (text/html) and known XHTML types (Appendix C), but that's all.
The WDG and Page valet validators don't issue such a warning:
http://www.htmlhelp.com/cgi-bin/vali...m&warnings=yes
http://valet.webthing.com/view=Asis/...&parseMode=web


They use basically the same logic, but just spare you that particular
inappropriate warning.

Speaking as the developer of Valet, I wouldn't have embarked on that
project if I didn't think I could do, in some way, a better job than
the existing services (I've also had some slight input into the W3C
service, but they haven't adopted any of my more substantial ideas).
The net result is: you have a choice to use whichever service you
prefer.

--
Nick Kew
Sep 7 '05 #5

P: n/a
Refer to: http://esw.w3.org/topic/MarkupValidator/M12N

I find considerable merit in the XML Schema Validator of Christoph
Schneegans: http://schneegans.de/sv/

--
James Pickering
http://jp29.org/

Sep 7 '05 #6

P: n/a
James Pickering wrote:
I find considerable merit in the XML Schema Validator of Christoph
Schneegans: http://schneegans.de/sv/

Indeed. Do you also like http://badame.vse.cz/validator/ ?
All good services for their intended purpose, which is in
each case slightly different from HTML validation.

--
Nick Kew
Sep 7 '05 #7

P: n/a
Nick Kew wrote:
..... Do you also like http://badame.vse.cz/validator/ ?


I do indeed -- also your own excellent Page Valet:
http://valet.webthing.com/page/

--
James Pickering
http://jp29.org/

Sep 7 '05 #8

P: n/a
Gérard Talbot a écrit :

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1809


This bug 1809 was fixed today.

Gérard
--
remove blah to email me
Sep 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.