W3C home > Mailing lists > Public > www-validator@w3.org > October 2005

?? XML Mode, Using a Custom DTD ??

From: Bob Bronson <rbronson1976@yahoo.com>
Date: Wed, 5 Oct 2005 21:41:39 -0500
Message-ID: <000701c5ca1f$7ab4e6c0$0100a8c0@helen>
To: <www-validator@w3.org>

Hi All...

It was pointed out to me recently (by Lachlan Hunt) that using a "known 
public identifier" (e.g., "-//W3C//DTD XHTML 1.0 Strict//EN") in a 
DOCTYPE causes the validator to go into "XML mode", even if the content 
type of the document is non-XML
(e.g., "text/html"). In fact, my testing shows that using a "known 
public identifier" seems to cause the validator to ignore the system 
identifier completely! For example, using the following DOCTYPE, my 
XHTML Strict document validated just fine:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "Queen 
Victoria">

It seems that once the validator recognized the public identifier 
("-//W3C//DTD XHTML 1.0 Strict//EN", in this case) it used some 
existing, cached copy of the "xhtml1-strict.dtd" DTD to validate the 
document. It did *not* consult the DTD in the system identifier ("Queen 
Victoria", in this case), but instead, completely ignored it.

This leads to my question: Is it possible to use a "known public 
identifier" *AND* still tell the validator to use a custom DTD? In 
other words, I want to use a "known public identifier" (so that the 
validator goes into "XML mode") BUT I want the validator to use *my* 
version of the DTD, not the one it has cached somewhere.

As a final note, I find I am able to get the validator to use my custom 
DTD but to do so I have to specify an unknown, "custom" public 
identifier *AND* I have to serve my XHTML document as an XML document 
(e.g., "application/xhtml+xml") so that the validator stays in XML 
mode. I realize it is "more correct" to server XHTML as 
"application/xhtml+xml" but I prefer to serve it as "text/html" as a 
concession to IE 6.

Thanks very much
--
Bob Bronson 
Received on Thursday, 6 October 2005 03:38:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:20 GMT