cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [PATCH] Sitemap Draft - Misc. fixes and preliminary schema
Date Tue, 04 Jul 2000 10:45:43 GMT
"N. Sean Timm" wrote:
> 
> "Stefano Mazzocchi" <stefano@apache.org> wrote:
> > > If you're going to have a <doc-type> node, I think it either needs to
> reside
> > > in some sort of parameter namespace (which seems messy), or you should
> have
> > > to specify it like the following:
> > >
> > > <map:param name="doc-type" map:value="bac.dtd"/>
> > > or
> > > <map:param name="doc-type">bac.dtd</map:param>
> >
> > Sean, I don't see your problem with
> >
> >  <doc-type map:value="bad.dtd"/>
> >  <doc-type>bac.dtd</doc-type>
> >
> > Each component will have access to configurations and namespaces don't
> > make it any simpler nor more powerful.
> >
> > I vote -1 to adding a new namespace for each component. The sitemap will
> > "consume" its namespace and make available to components everything
> > else.
> >
> > I don't see any problem with this.
> 
> During my initial schema work, I came under the impression that those
> parameters *had* to be declared in a namespace in order to create a schema
> at all.  I see now that this is not the case.  So, yes, we could allow
> anything in the default namespace as parameters.  The only consequence is
> that all parameter names/values will not be able to be validated against a
> schema.

Of course, that's the point.

> I like the idea of being able to validate the entire sitemap
> against a schema while I'm developing it.

??? careful: "validation" is the act of saying if some file is valid or
not.

When your component does:

 conf.getConfiguration(String path, bookean required);

and the required configuration is not there, this is a validation
problem.

You clearly showed how complex a sitemap becomes if you use XSchema to
validate everything... and how unbalanced it might become later on when
you add your components and you have to ask for "namespace granting"
around here.

Here, you simply place your own validation inside your logic and the
Avalon classes will provide ways to make it so simply you don't even
know you are actually validating something while using it.

Cocoon could also be run from the command line in "sitemap validation
mode", just like Apache can.

> It would certainly help prevent certain simple (but stupid) mistakes.

Oh, please don't forget that DTD and XSchema are just two of the
infinite possible ways to validate a document. The first works ok with
mono-dimensional XML documents, the second is more complex but still
very limited compared to any turing-complete language.

> On the other hand...doing it like
> I suggested (ie. <map:param name="foo" value="bar"/> wouldn't allow
> parameter validation, either.

Yes.

> Like I mentioned, I didn't like declaring
> namespaces for the parameters, either, but it's the only way to validate the
> parameters.  Is this something anyone cares about?  I'm rather ambivalent at
> this point, so I'm curious if anyone else feels that schema-based parameter
> validation is important.  If not, then the default namespace works just
> great.

It's not a matter of "caring about validation", of course we all care to
see Cocoon say "hey, I need this parameter here"!

The point is: should XMLSchema take care of all possible cases?

My (pretty strong) answer is no.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message