473,394 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Unknown Parse Mode! warning from w3c validator with custom doctype

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
8 7394
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ph47f3 | last post by:
I get a strange parse error in the following lines. Can anyone see what I don't. //Query the Database $query = "SELECT type FROM `map` WHERE map_file = " . $_SESSION . " AND col = " ....
4
by: Ray B. X. Zhou | last post by:
I use xml.sax to parse big5 encoding xml file. And I got message "unknown encoding: big5". What can I do? Thank you very much. Ray
4
by: David Moore | last post by:
Hello I am using the System.DirectoryServices namespace classes to access Active Directory. We connect using the LDAP://DOMAIN method. The code works on local dev boxes, and in staging, but...
7
by: Richard Hayden | last post by:
Hi, I've just upgraded my gcc and I'm currently trying to compile some code for my own operating system kernel, but I am getting an error of "Undefined reference to `memcpy`" when I try to link...
2
by: Brecht Yperman | last post by:
Hi, when calling the XmlSerializer constructor, I get the following error: Top Level Exception Type: System.IO.IOException Message: Unknown Error (-1). Source: mscorlib...
7
by: jccorreu | last post by:
I've got to read info from multiple files that will be given to me. I know the format and what the data is. The thing is each time we run the program we may be using a differnt number of files,...
12
by: Sachin Punjabi | last post by:
Hi, I wanted to read a file encoded in utf-8 and and using the following syntax in my source which throws me an error specifying Lookuperror : unknown encoding : utf-8. Also I am working on...
2
by: belovah | last post by:
Hey!! Can anyone please tell me what's wrong with this line. I'm totally lost :s Error: Parse error: parse error, unexpected '.' in C:\Server\www\4images\includes\functions.php on line 479 ...
23
by: Himanshu Chauhan | last post by:
Hi! I was wondering, In the first parse of a singly linked list of unknown length, is it possible to know when we are at middle of the linked list? Regards --Himanshu
1
by: Gramma2005 | last post by:
I am trying to connect to an access db through php on Windows Server 2003 running XAMPP. The code I am using has worked before on another access db on this server so I am not sure what is causing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.