cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominic Chambers <>
Subject Re: <mount>ing, but with shared sitemap?
Date Fri, 20 Jun 2003 15:30:59 GMT
On Fri, 2003-06-20 at 16:25, Upayavira wrote:
> > Yes. Exactly that. Is that possible?
> Hmm. As I was writing that I was hoping you weren't going to say yes!!
> Anyway, I have built something similar recently, although I didn't have the two 
> sitemaps, I did it all with one.
> I used stuff like:
> <map:match pattern="*/page.html">
>   <map:generate src="skins/{1}/config.xml"/>
>   <map:transform src="common/prepare.xsl"/>
>   <map:transform src="skins/{1}/skin.xsl">
>     <map:parameter name="skin" value="{1}"/>
>   </map:transform>
>   <map:serialize type="html"/>
> </map:match>
> There you have a site that'll work for the following structure:
> root/
>   sitemap.xmap
>   skins/
>     foo/
>       config.xml
>       skin.xsl
>     bar/
>       config.xml
>       skin.xsl
>   common/
>     prepare.xsl

Yes, that is very clever, I didn't think of that; that even works if you
need to match multiple pages by using two wildcards, like "*/**.html". 
but ...

> With a system like that, you can have some files accessed from your 'skins' directory

> structure, and others from your common shared files, depending upon whether you 
> want them shared or separate.
> Then you just need an error handling pipeline to catch those situations where the 
> URL doesn't match a valid skin.
> Make sense? Does this do what you want?

Almost, but I need to switch based on host name. Perhaps if I could make
the result of the host name comparison a variable, like {1} is for
wildcard matches, that would work perfectly. I just tried this

  <map:match pattern="">
    <map:select type="host">
      <map:redirect-to uri="{host}/test.html"/>

where host was a previously defined HostSelector. Of course it didn't

Do you know of another way? I kind of need variables, although I would
probably think less highly of Cocoon if it provided them: who wants to
program in XML?

Thanks for your help!

> Regards, Upayavira
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message