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:[EMAIL PROTECTED]]
> Sent: Friday, July 26, 2002 11:47 PM
> To: [EMAIL PROTECTED]
> Subject: RE: How to switch to another resource if one resource is not
> available?
>
>
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> >
> >
> > 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:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


---------------------------------------------------------------------
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:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to