cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject RE: How to switch to another resource if one resource is not available?
Date Mon, 29 Jul 2002 19:43:37 GMT
Vadim,

That's very interesting. I don't recall ever seeing 'peer' <map:act>
elements in the various sample sitemaps, only nested <map:act> elements.

Does that also mean that one could do the following to selectively read from
an existing file or apply transforms?

<map:match pattern="*.fragment">
  <!-- If the file is static, return it now -->
  <map:act type="resource-exists">
    <map:parameter name="url" value="{1}.fragment" />
    <map:read ... />
  </map:act>

  <!-- Choose a source -->
  <map:generate src="{1}.xml">

  <!-- If XSLT of same name exists, use it otherwise skip it -->
  <map:act type="resource-exists">
    <map:parameter name="url" value="{1}.xsl" />
    <map:transform src="{../1}.xsl" />
  </map:act>
  <map:serialize />
</map:match>


Per

> -----Original Message-----
> From: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net]
> Sent: Friday, July 26, 2002 11:47 PM
> To: cocoon-users@xml.apache.org
> Subject: RE: How to switch to another resource if one resource is not
> available?
>
>
> > From: Joern_Hoos@notes.uni-paderborn.de [mailto:Joern_Hoos@notes.uni-
> >
> >
> > Finally got it! The {1} vs. {../1} thing was a little tricky to find
> out.
> > BTW: If both (jpg and svg) exist,  though both actions should be
> taken,
> > cocoon seems to prefer the svg. How is the conflict resoveld? Is any
>
> First encountered
>
> > <map:serialize> or <map:read> final and the rest ignored?
>
> And execution of the sitemap stops. Yes.
>
>
> Vadim
>
>
> >        <map:match pattern="images/**.jpg">
> >           <map:act type="resource-exists">
> >             <map:parameter name="url" value="images/{1}.svg"/>
> >             <map:generate src="images/{../1}.svg"/>
> >             <map:serialize type="svg2jpeg"/>
> >           </map:act>
> >           <map:act type="resource-exists">
> >             <map:parameter name="url" value="images/{1}.jpg"/>
> >             <map:read src="images/{../1}.jpg" mime-type="image/jpeg"/>
> >           </map:act>
> >        </map:match>
> >
> >
> > Joern
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message