Re: Error in validator?

Benjamin Tomos Lewis [benl.co.uk - Webmaster] wrote:

> 
> Hi,
>     I'm not sure if this is a bug, or something else -  I've edited the
> XHTML 1.0 Strict DTD to allow the XML Schema inclusion attributes
> (xmlns:xsi and the like) so as to include the XHTML 1.0 Schema (as
> defined in a W3C Note - http://www.w3.org/TR/xhtml1-schema/), and
> according to XMLSpy everything is fine. However, the FPI for the DTD is
> the same, I merely changed the SYSTEM identifier, and it appears -
> whether rightly or not - that the validator is using an internal DTD
> rather than the adjusted one. The problem being that some user agents
> don't seem to treat pages as xhtml if one changes the FPI thus meaning
> it has to be the same. I was thinking that a satisfactory resolution
> would be a sort of override option for the validator that forces it to
> use the specified DTD and not the internal one. Alas, however, I may be
> wrong and there may be another way - in which case I would be most
> grateful if someone could point it out.

If the validator encounters a known FPI, it will retrieve the SYSTEM
identifier from its own catalog, which points to a local copy of the DTD.
There should be a warning (this issue has been raised before on the list),
if the SYSTEM identifier from your doctype declaration does not match the
'expected' values based on the PUBLIC identifer.

The behaviour of the validator (not looking at SYSTEM, if PUBLIC is known)
is common for sgml and (validating) xml parsers. You should note that
browser do not use validating parsers, so they will not look at your
modified DTD anyway - the doctype declaration is only used for
quirks/standards mode selection, if the document is served as text/html.

In order to get 'correct' validation by the validator, serve it as
application/xhtml+xml and use your own FPI, to force the XML parse mode
even if the validator does not find a known XHTML FPI. But this will
trigger quirks mode rendering in browsers, if served as text/html...


-- 
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/

Received on Friday, 28 October 2005 23:35:46 UTC