cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: Small note on sitemap configuration
Date Fri, 02 Jun 2000 16:20:21 GMT
On Thu, 1 Jun 2000, Stefano Mazzocchi wrote:

> > i'm simply saying that a sitemap that allows conditionals based
> > on something like this:
> > 
> > <process uri="whatever">
> >  <matcher type="browser" value="explorer">
> >   <matcher type="language" value="en">
> >    <generator type="file" src="explorer.xml">
> >   </matcher>
> >   <matcher type="language" value="it">
> >    <generator type="file" src="explorer.it.xml">
> >   </matcher>
> >  </matcher>
> >  <matcher type="browser" value="lynx">
> >   <matcher type="language" value="en">
> >    <generator type="file" src="lynx.xml">
> >   </matcher>
> >   <matcher type="language" value="it">
> >    <generator type="file" src="lynx.it.xml">
> >   </matcher>
> >  </matcher>
> > </process>
> >
> > That's hella-cumbersome, and doesn't factor out the conditionals very
> > well. My strategy would let you rewrite it like this:
> > 
> > <process>
> >  <choose>
> >   <when test="$language='en'">
> >    <generator type="file" src="{$browser}.xml"/>
> >   </when>
> >   <when test="$language='it'">
> >    <generator type="file" src="{$browser}.{$language}.xml"/>
> >   </when>
> >  </choose>
> > </process>
> >
> > I think that's much easier to understand and write. 
> 
> I think
> 
>  <process uri="**">
>   <generator test="lang-browser-file" src="**"/>
>  </process>
> 
> is much easier to understand and write :)

Yeah, but what's going to process the test="lang-browser-file" attribute?
What name mangling scheme is it going to use to get to the proper file,
and what if an author wants to use a different scheme? What if they also
want the scheme to depend on the HTTP header for some stupid reason?

> I have two main concerns:
> 
> 1) once you start this programmatic road, pretty sure people will ask
> for <for> loops, procedures and all that stuff. I've seen this happening
> for Ant. I think there is an evident sign already, we _don't_ need such
> complexity, not even the variables.

I disagree. There's absolutely no need for looping, subroutines,
declarative variables, etc. Just the need for conditionals and expression
evaluation.

> 2) this requires you to think! Sure, I can't force you to think, but
> it's good to try.

Ha! I am thinking, and I think you're wrong. :)

> Example?
> 
> Java avoiding multiple inheritance. That's the best ever.
> 
> Have you ever wanted multiple inheritance? I did. Badly. It forced me to
> go to my whiteboard and layout my OO strategy. Now I don't anymore
> because I saw the problem and my design improved.

That's smokescreen, it isn't exactly relevant to this discussion. Trying
to sidetrack me, you are... :)

> Careful, a sitemap with no variables is, to me, the exact equivalent.
> You should _not_ place logic into the sitemap... by creating variables
> and run-time parameters.... it would soon make the sitemap too complex
> to handle.

But you _already_ have logic in the sitemap. What else is the matcher
element but a boolean conditional? I do _not_ think we need to _create_
variables in the sitemap, just reference them.

> On the other hand, I do see the need for such a thing.... it's another
> of those things I need more feedback to evaluate....
> 
> The problem is that once we add it and people start using it, we can't
> remove it later on. So we must decide if this is FS or not _before_
> placing it in.

Well, I dunno. Cocoon2's in alpha, so we should still be able to make
these type experiments without affecting anyone seriously. I see your
point, though, which is why I find this discussion quite valuable.

- donald


Mime
View raw message