Jonathan Watt wrote:
> On Wed, 30 Mar 2005 15:53:40 +0200, Robin Berjon <robin.berjon@...>
wrote:
>>Use DTDs for validation if you want (they won't validate much but it's a
>>start) but don't use DOCTYPE. It's useless.
>
> The most accessible validator is the one provided at validator.w3.org
> - it doesn't allow you to specify the DTD that should be used. It may
> allow you to select a "Doctype", but SVG isn't on the list that's
> provided. It seems to me that it's still useful to include a DOCTYPE
> in this case.
It may be accessible but it's not terribly useful as an XML validator.
This however is being worked on.
> Furthermore, for those of us who get emails saying "this page doesn't
> work in your SVG implementation" it would be useful to be able to
> throw the URL into the W3C validator to help in debugging without
> having to manually choose/type an SVG DTD URL as well.
It'll take a little while but an SVG validator that works better much
than that is being worked on. The RNG that's in 1.2 will go a long way
in helping
> Even if DOCTYPEs don't have clear uses to you, why so strongly
> discourage their use unless they are actively harmful?
There's a bunch of issues, but just to pick a few:
- they'll give false positives. This is true of all schema languages as
none of them can express sufficient constraints, but in the case of
DTDs they are so ridiculously under-expressive that the content
models of some elements are really, really loose compared to what the
spec requires. After DTD validation you still don't know that you
haven't done something really stupid.
- they'll give false negatives. This is quite seriously broken. If you
rely on DTDs to tell you when something is broken, you might well end
up spending hours trying to debug a document that seems perfectly
fine only to realize at the end that it's just the DTD being wrong.
This is not the fault of the authors of the SVG DTD, it is simply
impossible to author a DTD that will not give false negatives.
- they're namespace-unaware. You know better than I do that the number
one mistake is to forget the namespace. DTDs won't catch that because
they don't know about namespaces.
- they don't wildcard. It is perfectly fine in SVG to introduce
elements and attributes in other namespaces, and there even are
extension points dedicated to that. Unless you modify the DTD, this
will always give you a false negative.
So when they say OK they really haven't checked anything, when they say
NOT OK they might be on crack, and like all namespace-unaware things
they're a dead branch of the XML tree. But feel free to use them anyway :)
--
Robin Berjon
Research Scientist
Expway, http://expway.com/