cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: validation of config during build (Was: Re: sitemap validation is broken)
Date Fri, 07 Mar 2003 16:55:56 GMT
Sylvain Wallez wrote:
> Stefano Mazzocchi wrote:
>> David Crossley wrote:
> <snip/>
>>>                          -- o --
>>> The other purpose of my original message was to raise an alarm
>>> about the change in parameter names in the sitemap, which now
>>> do not correspond with code o.a.c.transformation.TraxTransformer
>> I'm more and more considering sitemap validation harmful.
>> why:
>> 1) the sitemap logic is too hard to be validated from any validation 
>> language (it requires java runtime capabilitles)
>> 2) it reduces the effort of clean and meaningful error messages in the 
>> treeprocessor
>> Example, try
>>  <generate uri="..."/>
>> where the uri attribute is not allowed in generate (shoulc be 'src'), 
>> the treeprocessor totally ignores this and sends the empty string to 
>> the parser, resulting in the error
>>  System ID not found!
>> Sitemap validation has stopped us from fixing the error messaging 
>> capabilities on mistakes.
>> I propose to blast the sitemap validation alltogether.
> I don't follow you : a schema, although it cannot fully validate a 
> sitemap, can easily check syntax inconsistencies like <map:generate 
> uri="..."/>. The checks performed by the treeprocessor come at a lower 
> lever such as controlling that a used component (type="...") exists, 
> check variable expansion syntax, etc.

Yes, this is *exactly* the reasoning that makes the treeprocessor error 
messages meaningful only if you hit a spot that is not validatable by 
the sitemap.

You are assuming people validate the sitemap before entering it in the 

Unfortunately, this is not automated internally and, externally, only 
few people do.

Result: the level of error message friendlyness of treeprocessor syntax 
errors is poor and users are more often misplaced by them than helped.

> So it seems to me validation is good to easily write a syntax checker 
> and let the java code in treeprocessor concentrate on more detailed 
> "semantic" validation.

too bad this is not done.

> Now the problem, AFAIU, comes more from the fact that we're trying to 
> validate not only the sitemap, but also the configuration of each 
> component, which may take very various forms and obey to some 
> complicated logic.

yes, but this is an argument on how the sitemap descriptor is defined. 
Why does everybody think that validation and schemas are synonims?

View raw message