W3C home > Mailing lists > Public > public-qa-dev@w3.org > August 2006

Re: please add SVG as option for enforcing DOCTYPE

From: Ruud Steltenpool <svg@steltenpower.com>
Date: Fri, 4 Aug 2006 12:25:10 +0200 (CEST)
Message-ID: <2239.>
To: public-qa-dev@w3.org

>> cause i often consider remarks about foreign namespace things pollutin
>> my SVG validation results, I built something that:
>> -assumes a document is SVG (which can include Xlink)
>> - turns <foreign:something><svg:sth /></foreign:something> into
>> <svg:sth />
>> (Is this how an SVG renderer should work?)
>> - throws out attributes in foreign namespace
>> -sends it off to the W3C validator with DOCTYPE enforced.
> I see, so it's a way for you to work around validation issues with
> multiple namespaces documents? Do you also have another way of
> checking all the things in these foreign namespaces, or is the main
> goal to make sure that the part in the svg namespace is at least OK?

Main goal now is just SVG, however...
.... i think the following variation though not perfect can detect errors
in each other namespace:
Filter now-foreign namespaces out. This could leave you with multiple
trees to validate separately. If the root of any of those is not an
allowed root in the DTD, add a root parent that is. Now find a DOCTYPE
'belonging' to this namespace, and enforce that DOCTYPE when sending stuff
to validator.w3.org

With many namespaces and for every namespace possibly multiple reduced
trees, this could mean a whole lot of resulting documents to validate,
where we started from just one. I'm not trying to make something fast and
perfect here though with my limited knowledge of the subject, just
thinking/hacking towards something that:
- detects many errors,
- gives warnings about certain things to do or avoid (applying
cross-viewer authoring guidelines for example in the case of SVG)
- makes a rather practical debugging tool

>> Possible improvements:
>> -Know the full internal list of validator.w3.org DOCTYPEs
> These are in the CVS repository for the validator, that may be of
> interest to you:
> http://dev.w3.org/cvsweb/validator/htdocs/sgml-lib/sgml.soc
> http://dev.w3.org/cvsweb/validator/htdocs/sgml-lib/xml.soc
> and also at http://dev.w3.org/cvsweb/validator/htdocs/conf/types.cfg


>> -guess the right DOCTYPE based on the document
> Hmm, That would be fairly easy done by parsing the version attribute
> of the <svg> element, if present. Less so if the document is not SVG,
> but your idea is to run this only on SVG documents, right? Note
> however that AFAIK, there is no doctype for the SVG1.2 family.

Again, at the moment it's SVG, but taking it more general would be better
of course. Via the version attribute is perfect. If that's not available
offer a dropdown of options, pre-select a good guess. Considering
SVG1.2:No DOCTYPE, means no DTD check, simple as that. I expect there to
be a schema of some sort XSD,RNG for 1.2 though, which brings other types
of validation.

>> -correctly interprete xmlns used on other then the root element
> Any idea how you would use that?

Now i filter on prefix, assuming "svg" relates to the SVG namespace
(everywhere in the document), same for "xlink". This
assumption/shortcut/hack works for my docs and probably that of many, but
you can't trust coincedence.

>> What's your opinion on this?
>> Useful as long as clear warnings are present?
>> Maybe an idea for THE validator?
> I don't consider myself to be enough of an expert to give a very well
> informed, let alone authoritative, opinion :). It seems to me like a
> useful hack, if multi-ns documents are important to you but you still
> want the benefits of validation for the SVG basis. I guess that as
> long as all the namespaces involved have a clear schema associated
> with them, a solution based on NRL would be less of a hack, but I'm
> still rather puzzled by how this could be done properly since some
> namespaces are associated to various versions of a technology (e.g
> xhtml), hence different schemas. Bear with me, I am still catching up
> with these issues...

I appreciate your opinion, it seems rather expert to me.
I'm just a guy that keeps a bit track of what technologies are out there,
what's good for what, only really learns about them when needed, and
sometimes tries to show people what they didn't know they needed :-).
As i now need good SVG debugging tools, building tools (on top of the
validator),seemed the way, therefore i now Google-fed myself bits on DTD,
SAX, etc.

> Chris, whom I'm copying in this mail, would probably be way more
> knowledgeable about whether your solution is a good idea or not. I'll
> let him chime in if he has anything to add.

/me whispers: he knows everything

Thanks, Ruud
Received on Friday, 4 August 2006 10:43:31 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:36:26 UTC