On Sat, Mar 08, 2003 at 10:03:31AM +0100, Sylvain Wallez wrote:
> Steven Noels wrote:
> 
> >Stefano Mazzocchi wrote:
> >
> >>Steven Noels wrote:
> >
> >>>Looking at the history of sitemap-v06.rng, I can't see this has been 
> >>>happening a lot. Quite contrarily, some (myself included) have been 
> >>>advocating to relax it even further. But dropping it will 
> >>>effectively kill the small circle of people interested in 
> >>>maintaining such a thing.
> >>>
> >>>Reasonable?
> >>
> >>
> >><read my lips> I AM NOT SUGGESTING TO DROP THE SCHEMA!!! </read my lips>
> >>
> >>is that clear enough? should I repeat it?
> >>
> >>I'm suggesting to remove the validation target from the build system 
> >>and improve the way treeprocessor handles errors.
> >>
> >>As I said, i don't care *how* this is done, as long as the error 
> >>messages that users receive are much more meaningful than those silly 
> >>"System ID no found" when an attribute name is wrong.
> >
> >
> >I'm going to be stubborn about this: _if_ we drop the target (I was 
> >already aware of you not pushing to drop the schema, no problem here), 
> >then the few people who care about the schema won't be warned about 
> >required changes anymore.
> >
> >I don't see any relation between the grammar, where and when it should 
> >be used, and the lack of exception handling code in the tree processor.
> >
> >But since we are the only one who care to continue this thread, let's 
> >drop it. I'm going to check what Sylvain has to say about it.
> 
> 
> Well, I thought I made it clear : although I've not considered the 
> technical details now, I would like to integrate schema-driven syntax 
> checks (I avoid the ambiguous "validation" word) _inside_ the 
> treeprocessor (i.e. at sitemap load-time) to be sure that the sitemap is 
> correct since we cannot assume each user will perform pre-runtime checks.
> 
> The technical details I'm referring to are how we can get meaninful 
> messages from schema-driven syntax check, so that we can display them to 
> the user.
> 
> The benefits of this approach are IMO mutiple :
> - runtime checks, offline checks and schema-driven editors use a single 
> definition of the sitemap grammar,
> - since this grammar becomes an integral part of the sitemap engine, it 
> ensures its consistency and long-term maintainance.

My rather unhelpful 2c (knee-deep in Forrest ATM):

For validating an incrementally composed structure like the sitemap,
it might be better to use a rule-based language like Schematron, rather
than RelaxNG/XSD.  Reasons being:

 - In Schematron, the XML is considered valid by default, and
   subsequently constrained.  This assumption makes sense for the
   sitemap, because people will always be defining new components outside
   our control.

 - Schematron handles co-occurrence constraints, e.g. "only check for
   map:generator/driver if @src contains 'XMLDBGenerator'".  With RNG I
   think we'd have to say "anything goes" in user-extensible sections.

 - Schematron schemas combine very naturally.  We could have a schema per
   block, validating just that block's elements, and apply the block
   schemas iteratively.  With RNG, merging block schemas would be *much*
   harder.

 - Jing error messages are completely awful.

Perhaps a Schematron variant subsetted to support STXPath [1] would be
the best Cocoon validation system.  


--Jeff

(who had a long and fascinating talk with Rick Jelliffe a few weeks ago,
and is now a convert, at least until I meet James Clark)


[1] http://www.xml.com/pub/a/2003/02/26/stx.html

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

Reply via email to