Given something like [the reason if the generality is that it depends on
your site design]:

<!-- re-inserted for completeness -->
<map:match pattern="*/**.html">
    <map:act type="resource-exists" src="docs/{2}_{1}.html">            
        <map:generate src="docs/{../2}_{../1}.html"/>
        <map:serialize type="xml"/>
    </map:act>
    <map:generate src="docs/{2}.html"/>
    <map:serialize type="html"/>
</map:match>

requesting   

  http://my.server:8080/cocoon/apache/overview.html

will first test whether the resource

    docs/apache/overview_cocoon.html 

exists, 
if it exists, then it is returned, otherwise

    docs/apache/overview.html 

is served.

The key point is that using a combination of URL fragment matching (to get
the desired look&feel) and resource exists testing to serve default content
if absent is a simple, yet powerful technique.

As the matchers work equally well for browser or cocoon initialated URLs,
the same technique can be used to provide customised / default selection of
XSLT stylesheets, for example


[assuming the same style pipeline fragment as above, but matching on xsl]
  ...
  <map:transform src="cocoon:/cocoon/apache/lnf.xsl"/>

could try to locate an XSLT file named  apache/lnf_cocoon.xsl, defaulting to
apache/lnf.xsl.

/Adrian


> -----Original Message-----
> From: Mato Mira, Fernando [mailto:[EMAIL PROTECTED]
> Sent: Wednesday 28 May 2003 10:41
> To: '[EMAIL PROTECTED]'
> Subject: RE: Customization
> 
> 
> > -----Original Message-----
> > From: Geissel, Adrian [mailto:[EMAIL PROTECTED]
> > 
> > How about using something like the following pipeline matcher 
> > along with the
> > resource exists action
> > 
> [solution elided]
> 
> > It also works well in for selecting stylesheets when 
> combined with the
> > cocoon protocol in map:transform/@src
> >    
> 
> Could you please give an example?
> 
> Thanks
> 

Any e-mail message from the European Central Bank (ECB) is sent in good faith but 
shall neither be binding nor construed as constituting a commitment by the ECB except 
where provided for in a written agreement.
This e-mail is intended only for the use of the recipient(s) named above. Any 
unauthorised disclosure, use or dissemination, either in whole or in part, is 
prohibited.
If you have received this e-mail in error, please notify the sender immediately via 
e-mail and delete this e-mail from your system.

Reply via email to