cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: validation of config during build (Was: Re: sitemap validation is broken)
Date Fri, 07 Mar 2003 23:28:18 GMT
Stefano Mazzocchi wrote:

> Sylvain Wallez wrote:
>
>> Stefano Mazzocchi wrote:
>>
>>> Sylvain Wallez wrote:
>>
>>
>> <snip/>
>>
>>>> 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.
>>
>>
>> So what about *requiring* schema-validation to happen each time a 
>> sitemap is loaded, i.e. have the use of a validating parser be 
>> hard-coded in the treeprocessor. This schema-validation phase would 
>> be a part of the global consistency checks performed by the 
>> treeprocessor,  implemented by tools adequate for this task.
>
>
> I'm only concerned about getting useful error messages out of sitemap 
> loading. I don't care how this is achieved.
>
>>>> 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?
>>
>>
>> I don't think they are synonyms, but that a schema is an adequate 
>> tool to easily perform the first phase of a global validation process.
>
>
> From a developer's point of view, sure. From a error message 
> readability point of view, I strongly doubt it since treeprocessor can 
> have much better and meaningful error messages than any validation stage.
>
> I'm not being negative, I'm just trying to reduce the number of 
> misconfiguration questions that will happen on cocoon-users as soon as 
> we release cocoon 2.1
>
OK. I understand your concern. Let's recap the various concerns on the 
table in this area :
- you (and we, this was also one of my goals in the treeprocessor) want 
meaningful messages
- I like a first validation phase driven by a schema for its ease of 
development,
- Steven wants schema-driven editors.

So IMO, what we need is find a way for a schema syntax validator to give 
some meaningful messages for what it is in charge of, which is 
controlling that elements and attributes are the one the sitemap engine 
is waiting for.

Taking your previous example, having "invalid 'uri' parameter at 
foo/sitemap.xmap:145:28" seems meaningful to me. Once this phase is 
successful, it's the treeprocessor responsibility to output messages 
like "Cannot find a generator named 'bar' at foo/sitemap.xmap:145:15" 
(as it already does today).

Thoughts ?

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



Mime
View raw message