NVDL, SVG validation (Was: first questions on validator.nu)

Hi Henri, all.

On Dec 7, 2007, at 20:42 , Henri Sivonen wrote:
>> I wonder if it would be possible to preparse documents with SVG  
>> media type and look for version and baseprofile attributes on the  
>> root element, switching between SVG tiny, basic and full based on  
>> that.
>
> I'm not sure if NVDL could already do that.

No, I don't think so either, since nvdl has its rules and triggers  
based on namespaces, as far as I can tell. This would mean that using  
a different schema for different versions or profiles of a language  
using one namespace (as SVG, or indeed xhtml, do) would need a pre- 
parse. In the case of SVG it's not that bad since the version/ 
baseProfile information is on the root element, but it does need an  
xml-preparsing.

I wonder if there's a part of nvdl that does that, and which I haven't  
found yet.

> Currently, the automatic schema selection for XML documents is based  
> on the root element namespace. This is implemented in  
> nu.validator.servlet.BufferingRootNamespaceSniffer. Since the SVG  
> baseProfile and version attributes occur on the root element if  
> present, it would be relatively easy to make the sniffer sniff those  
> attributes as well and to extend the schema selection mechanism to  
> label schemas not only with the namespace URI but with other data as  
> well.

Indeed. Noted. I see  
nu.validator.servlet.BufferingRootNamespaceSniffer is basically a SAX  
handler and the action is happening in the rootNamespace method of  
nu.validator.servlet.VerifierServletTransaction. I'll see if I can  
make time to tweak it to look into version and baseProfile attrs. No  
promise, though, at least now there's a public archive of what to do  
and someone may pick it up before I do.

> I think SVG profiling is a spec misfeature, though, so I haven't  
> been particularly keen on developing support for it. However, I can  
> see why a W3C installation might want to support it, so I'd accept a  
> [suitably licensed] patch.
>
> Ideally, I'd like to see a single unified SVG spec whose latest  
> version the validator would track. That is, I'd prefer an "SVG5"  
> schema over profiles.

I suppose there was a good reason to create profiles for small  
devices... Anyway, that would be developer feedback for the SVG  
working group to hear.

>> I've heard a lot of arguments in favor of dropping anything in  
>> namespaces not known by the validator, and/or using nvdl to  
>> validate foreign namespace fragments. Is that something  
>> validator.nu can do, is it planned? I'm certain this would be a  
>> fantastic tool for the adoption of SVG.
>
> It might be that the NVDL part of oNVDL allows something like this  
> already. I haven't investigated yet. I have considered this issue,  
> though, and I am planning on punching a hole in the XHTML5 schema  
> for embedded RDF, for example.

I think that's be a perfect job for nvdl. See this example in the  
jnvdl documentation:
http://jnvdl.sourceforge.net/tutorial.html#d4e311

> I guess the SVG schema should get that hole, too. I have also  
> considered an option to filter out unknown namespaces, but I'm not  
> sure if it is good to open such "anything goes" holes in a validator.

Not a big fan of it myself, but there is an audience for it. I've  
heard it asked more than a few times now: a number of hackers want the  
right to play with the X in XML *and* get validation. It seems to be  
the very reason why nrl, and nvdl, were developed.

Thanks,
-- 
olivier

Received on Thursday, 3 January 2008 01:29:54 UTC