Error in validator?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Error in validator?

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

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.

    I wish to thank you for spending your time reading this
    and thank you, most graciously, in advance for your assistance

            Benjamin Lewis

--
Benjamin Tomos Lewis
Webmaster - benl.co.uk
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Benjamin Niemann

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/


Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Frank Ellermann

Benjamin Niemann wrote:

> 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.

Oops, what's an "expected value" for this simple procedure ?

For "historical reasons" I try to use FPIs with a system "id."
(URL) pointing to http://validator.w3.org/sgml-lib/ etc. on
all my pages.

That "historical reason" is of course that I didn't get the
simple idea:  well known FPI => use the known DTD, ignore the
system id.

Actually tricky, because not everything in this directory with
an FPI is also "well known" from the validator's POV, e.g. the
entities -//W3C//ENTITIES Publishing for MathML 2.0//EN need
http://validator.w3.org/sgml-lib/REC-MathML2-20031021/iso8879/isopub.ent

And I had some fun when they reorganized their sgml-lib... ;-)

> 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

Somehow it makes me nervous if everybody and his dog make up
FPIs, isn't that pointless if it's nowhere else "well known" ?
Why no <!DOCTYPE stuff SYSTEM "http://example.org/stuff.dtd"> ?

AFAIK that works.  There are also some cute nesting rules, if
stuff.dtd invokes more stuff with a relative URL, then the URL
of stuff.dtd is the base.  I can't say if that's just as it
should be, or only a feature of this validator, but it's nice.

                             Bye, Frank



Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Benjamin Niemann

Frank Ellermann wrote:

>
> Benjamin Niemann wrote:
>
>> 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.
>
> Oops, what's an "expected value" for this simple procedure ?

I'd say, e.g. for an HTML or XHTML FPI the respective URI as defined in the
specs. There may be cases of document types where there is no 'official'
URI for the FPI (HTML2.0 ??) - not sure how these should be handled...

>> 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
>
> Somehow it makes me nervous if everybody and his dog make up
> FPIs, isn't that pointless if it's nowhere else "well known" ?
> Why no <!DOCTYPE stuff SYSTEM "http://example.org/stuff.dtd"> ?
>
> AFAIK that works.  There are also some cute nesting rules, if
> stuff.dtd invokes more stuff with a relative URL, then the URL
> of stuff.dtd is the base.  I can't say if that's just as it
> should be, or only a feature of this validator, but it's nice.

You're right, it is indeed better to omit the PUBLIC part in such a case.


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


Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Frank Ellermann

Benjamin Niemann wrote:

> e.g. for an HTML or XHTML FPI the respective URI as defined
> in the specs.

Okay, here's an example extracted from xhtml11F.dtd:

| For example, if you are using XHTML 1.1 directly, use the FPI
| in the DOCTYPE declaration, with the xmlns attribute on the
| document element to identify the default namespace:
|
|  <?xml version="1.0"?>
|  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">

If something sees this DOCTYPE and does _not_ know XHTML 1.1
it's proably lost, because "xhtml11.dtd" is no absolute URL.

Maybe it's smart and guesses an URL based on the //W3C// part
of the FPI.  But I doubt it, and besides it won't work for less
famous organizations...

> There may be cases of document types where there is no
> 'official' URI for the FPI (HTML2.0 ??)

... <joke> ...like the IETF or RfC-editor for RfC 1866 </joke>

                            Bye, Frank



Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Benjamin Tomos Lewis [benl.co.uk - Webmaster]
In reply to this post by Benjamin Tomos Lewis [benl.co.uk - Webmaster]

Thanks for all that.
Another point though, the note I mentioned uses the same FPI for a
changed DTD (see 1.5) so it appears we are both in error! I think an
easy solution, based on what you said is to use application/xhtml+xml
and browser sniff for IE so it can be changed.

Ben

--
Benjamin Tomos Lewis
Webmaster - benl.co.uk
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Benjamin Tomos Lewis [benl.co.uk - Webmaster]
In reply to this post by Benjamin Tomos Lewis [benl.co.uk - Webmaster]

Right, got it working with me own FPI now
http://validator.w3.org/check?uri=http%3A%2F%2Fbenl.no-ip.com%2Fbenl%2F&charset=%28detect+automatically%29&doctype=Inline&verbose=1

Thanks for all your help.

--
Benjamin Tomos Lewis
Webmaster - benl.co.uk
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Benjamin Niemann
In reply to this post by Frank Ellermann

Frank Ellermann wrote:

>
> Benjamin Niemann wrote:
>
>> e.g. for an HTML or XHTML FPI the respective URI as defined
>> in the specs.
>
> Okay, here's an example extracted from xhtml11F.dtd:
>
> | For example, if you are using XHTML 1.1 directly, use the FPI
> | in the DOCTYPE declaration, with the xmlns attribute on the
> | document element to identify the default namespace:
> |
> |  <?xml version="1.0"?>
> |  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
>
> If something sees this DOCTYPE and does _not_ know XHTML 1.1
> it's proably lost, because "xhtml11.dtd" is no absolute URL.
>
> Maybe it's smart and guesses an URL based on the //W3C// part
> of the FPI.  But I doubt it, and besides it won't work for less
> famous organizations...

Another reason why authors should be advised to use only
SYSTEM="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" - anything else
is either a typo or chances are high that the validator does not do what
the author expects.

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


Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Frank Ellermann

Benjamin Niemann wrote:

> Another reason why authors should be advised to use only
> SYSTEM="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" -
> anything else is either a typo or chances are high that the
> validator does not do what the author expects.

Obviously we arrive at different solutions for the same issue,
I'd try...
http://validator.w3.org/sgml-lib/REC-xhtml1-20020801/xhtml1-strict.dtd
...or for my 1.1 flat example...
http://validator.w3.org/sgml-lib/REC-xhtml11-20010531/xhtml11-flat.dtd

Oops, and that says that it is version 1.20, my local copy is
version 1.1 ;-)  But version 1.20 also has this comment with
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd>

Even the filename xhtml11-flat.dtd won't match.  But it's no
nonsense, see also (fragment won't work with legacy browers):

http://www.w3.org/TR/xhtml11/xhtml11_dtd.html#a_xhtml11_catalog

                             Bye, Frank



Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Benjamin Niemann

Frank Ellermann wrote:

>
> Benjamin Niemann wrote:
>
>> Another reason why authors should be advised to use only
>> SYSTEM="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" -
>> anything else is either a typo or chances are high that the
>> validator does not do what the author expects.
>
> Obviously we arrive at different solutions for the same issue,
> I'd try...
> http://validator.w3.org/sgml-lib/REC-xhtml1-20020801/xhtml1-strict.dtd
> ...or for my 1.1 flat example...
> http://validator.w3.org/sgml-lib/REC-xhtml11-20010531/xhtml11-flat.dtd

Why would you want to use these URIs? These are just 'implementation
details' of the validator and may change at any time for any reason.
Of course you *can* use them, and if you know what you are doing you will
simply ignore the potential warning issued by the validator. But many
people are not so aware of the effects of their doing...

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


Reply | Threaded
Open this post in threaded view
|

Re: Error in validator?

Frank Ellermann

Benjamin Niemann wrote:

 [http://validator.w3.org/sgml-lib/]
> Why would you want to use these URIs?

Because I happen to know that they exist, and reflect what the
validator really does (e.g. for those funny validator icons ;-)
The same FPI can apparently have _different_ DTDs.

http://validator.w3.org/sgml-lib/REC-xhtml1-20020801/ is "new"
from my POV - I filed a bug report or feature request when the
validator still used the old DTDs for XHTML 1.0 first edition
after August 2002.

It's really confusing for new users, and back in 2002 I had no
clear idea what the differences between 1st and 2nd edition
DTDs really were.  Today I could (probably) interpret a diff.

And then there's always the question of all "official" sources:

Who defines what "official" is ?  When did they ask me whether
I agree with their definition, what can I do if I disagree, is
this some commercial game, who's next claiming to have patented
the DTD or the name space or what else ?
 
> These are just 'implementation details' of the validator and
> may change at any time for any reason.

For XML FPIs the validator apparently expects that I use any
system id. I like, and then ignores it using its own sgml-lib.

The best way to reflect this behaviour from my POV is to say
what it really does, it uses validator.w3.org/sgml-lib/ DTDs.

> if you know what you are doing you will simply ignore the
> potential warning issued by the validator.

I only get a warning when I omit the system id. with XML FPIs.
For HTML 2 it's as you said, omitting the system id. is okay.

                             Bye, Frank